简体   繁体   English

Sencha Touch:如何使用CSS更改选择字段的颜色?

[英]Sencha Touch: how to change the color of selectfield using css?

Do we have any specified css for coloring the selecfield in sencha touch2? 在sencha touch2中,我们是否有用于着色selecfield的指定CSS?

My selectfield code as of now is as follows: 到目前为止,我的selectfield代码如下:

{
    xtype: 'selectfield',
    options: [
    {text: 'AI',  value: 'first'},
    {text: 'AK', value: 'second'},
    {text: 'BR',  value: 'third'}
    ]
}

You can use a separate css class for your select field. 您可以为选择字段使用单独的CSS类。 Use " css: 'yourclassname' " after your "xtype" value and define the class as 在“ xtype”值之后使用“ css:'yourclassname'”,并将该类定义为

.yourclassname{ background-color:#000;color:#fff;font:normal 12px Arial;}

So your code will be 所以你的代码将是

              xtype: 'selectfield',
              cls:  'yourclassname',
              options: [
                        {text: 'AI',  value: 'first'},
                        {text: 'AK', value: 'second'},
                        {text: 'BR',  value: 'third'}
                        ]

thanks 谢谢

Please check: http://docs.sencha.com/touch/2-0/#!/guide/theming 请检查: http : //docs.sencha.com/touch/2-0/#!/guide/theming

Using Sass & Compass is the right way for styling your app! 使用Sass&Compass是设计应用程序样式的正确方法!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM