Javascript Sencha Touch 2:在Android 4中输入占位符,但未居中
我正在尝试将占位符文本居中。它看起来以IOS为中心,但在安卓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 {
/*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;
}