我想更改工具栏中按钮的背景颜色。 我需要此按钮来显示摘要值。
我试过
cls: 'button-matching-auto',
在css文件中
.x-btn-button .button-matching-auto {
background-color: #10E0E0;
}
没有效果。
然后我尝试了
style: {color:'red'},
一样的:没有影响
我可以在 chrome 的开发者工具中看到应用了颜色, 但不可见。
怎么了?
最佳答案
“这是因为按钮有一个名为‘x-button’的 CSS 类,默认情况下背景颜色设置为‘#CCC’...” http://www.sencha.com/forum/showthread.php?208417-Change-image-button
{
xtype: 'button',
baseCls: 'null',
cls: 'buttonRed
}
...如果您只想要按钮的默认外观而不是灰色按钮...
我这样做是为了更改外观以获得默认外观:
dockedItems: [{
xtype: 'toolbar',
layout: {
pack: 'center'
},
defaultButtonUI: 'default', // get default look and feel
dock: 'bottom',
items: [{
xtype: 'button',
width: 200,
text: 'Download to Excel',
},{
xtype: 'button',
width: 200,
text: 'Another action',
}]
关于css - 更改工具栏中的按钮背景颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20474978/