简体   繁体   中英

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

Do we have any specified css for coloring the selecfield in sencha touch2?

My selectfield code as of now is as follows:

{
    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. Use " css: 'yourclassname' " after your "xtype" value and define the class as

.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

Using Sass & Compass is the right way for styling your app!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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