0

我们是否有任何指定的 css 用于为 sencha touch2 中的选择字段着色?

截至目前,我的选择字段代码如下:

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

2 回答 2

3

您可以为选择字段使用单独的 css 类。在“xtype”值之后使用“css:'yourclassname'”并将类定义为

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

所以你的代码将是

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

谢谢

于 2012-06-04T08:30:28.393 回答
0

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

使用 Sass & Compass 是设置应用程序样式的正确方法!

于 2012-06-04T08:41:18.513 回答