sencha的按钮背景颜色

问题描述:

我是新来的sencha touch。 我们如何将按钮的背景颜色更改为白色?我有一个按钮,每个角落有两个图像。我希望按钮是纯白色的。 我尝试使用的CSS是这样的:sencha的按钮背景颜色

.quest { 
background: url(../images/quest.jpg) no-repeat left, 
     url(../images/rightarrow.jpg) no-repeat right; 
     background-color: white; 
     border: none; 
     border-color:white; 
     padding-left: 50px; 
     text-align: left; 
} 

我的按钮是在这里:

{ 
    xtype: 'button', 
    text: '<div class="quest">Info</div>', 
    labelWidth: '100%', 
    name: '', 
    handler: function() {     
    } 
} 

我的按钮有灰色边框(在煎茶灰色默认按钮的颜色)与白色中旬。我如何使它完全白色?请帮忙。

我甚至试过:

style: "background-color: white" 

使用“CLS '属性解决了我的问题。

   { 

        xtype: 'button', 
        cls: 'btn', 
        text: '<div class="person">People</div>', 
        labelWidth: '100%', 


       }, 

在我app.css定义

.btn 
{ 
background-color: white !important; 
background-image: none; 
} 

我们有这么默认煎茶,touch.css属性都将被覆盖,重新界定两者的背景色和背景图像属性。谢谢Thiem Nguyen的帮助。

+0

很好地完成!唯一的是我们失去了压力感。任何想法如何添加呢? – SashaZd 2013-04-03 15:15:15

这应该呈现你想要的按钮:)

config: { 
     ui: 'plain', 
     text: 'Your Text', 
     style: 'background-color:white;' 
    } 
+1

谢谢。但是我已经提到我也使用过tha。它不工作。 – Akshatha 2012-04-05 08:40:52

+1

你有没有试过ui:'plain'?我刚刚尝试创建一个带有这些配置的按钮,效果很好 – 2012-04-05 08:42:42

+0

{xtype:'button', config:{ ui:'plain', text:'Your Text', style:'background-color :白色;' }}我尝试过这样。 – Akshatha 2012-04-05 08:52:32

就像蒂姆阮说,这将工作

  { 
       xtype:'button', 
       text:'text', 
       ui:'plain', 
       style:'background-color:white' 
      }