Button background color in sencha

时光毁灭记忆、已成空白 提交于 2019-12-05 14:10:45

Using 'cls' attribute solved my problem.

               {

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


                },

In my app.css define

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

We have to redefine both background-color and background-image properties so that the default sencha-touch.css properties are overridden. Thank you Thiem Nguyen for your help.

Just like Thiem Nguyen said, this will work

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

This should render your desired button :)

config: {
        ui: 'plain',
        text: 'Your Text',
        style: 'background-color:white;'
    }
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!