Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Sencha Touch 2:在Android 4中输入占位符,但未居中_Javascript_Css_Sencha Touch 2_Alignment_Text Alignment - Fatal编程技术网

Javascript Sencha Touch 2:在Android 4中输入占位符,但未居中

Javascript Sencha Touch 2:在Android 4中输入占位符,但未居中,javascript,css,sencha-touch-2,alignment,text-alignment,Javascript,Css,Sencha Touch 2,Alignment,Text Alignment,我正在尝试将占位符文本居中。它看起来以IOS为中心,但在安卓4上仍然是左对齐的 /*css code is below*/ #myinput input{ text-align:center!important; } #myinput input::-webkit-input-placeholder{ text-align:center!important; } //the view (.js file) has {

我正在尝试将占位符文本居中。它看起来以IOS为中心,但在安卓4上仍然是左对齐的

/*css code is below*/
    #myinput input{
        text-align:center!important;
     }
    #myinput input::-webkit-input-placeholder{
        text-align:center!important;
     }


//the view (.js file) has
{
    xtype: 'emailfield',
    name: 'myinput',
    id: 'myinput',
    required: true,
    placeHolder: 'myinput (optional)',
    listeners: {
      //some listeners are here
    }
}

我遗漏了什么?

写这篇文章的标准方式如下:

#myinput::-webkit-input-placeholder{
        text-align:center!important;
}

在#myinput之后没有“输入”,试试看

写这封信的标准方式如下:

#myinput::-webkit-input-placeholder{
        text-align:center!important;
}
在#myinput之后没有“输入”,试试看

Android在这里有一个bug:(,居中不起作用。你可以使用这个polyfill:并且它支持“force”属性。该属性使得它甚至可以在像Android这样的“支持”占位符的浏览器上运行

$('#myInput').placeholder({force:true});
然后使用常规CSS设置插件提供的占位符类的样式

.placeholder{
  text-align: center;
}
Android在这里有一个bug:(,居中不起作用。你可以使用这个polyfill:并且它支持“force”属性。该属性使得它甚至可以在像Android这样的“支持”占位符的浏览器上运行

$('#myInput').placeholder({force:true});
然后使用常规CSS设置插件提供的占位符类的样式

.placeholder{
  text-align: center;
}