-->

在煎茶按钮的背景颜色(Button background color in sencha)

2019-09-16 08:25发布

我是新来的煎茶触摸。 我们怎么改变一个按钮的背景颜色为白色? 我有一个在每个角落两个图像的按钮。 我想按钮是纯白色的。 我尝试使用的CSS是这样的:

.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" 

Answer 1:

使用“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属性覆盖。 感谢您添阮的帮助。



Answer 2:

就像蒂姆阮说,这将工作

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


Answer 3:

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

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


文章来源: Button background color in sencha