我有一个标签面板,里面有几个标签。我在标签中使用iconCls属性给每个标签一个图像和它的标题。我使用的是fam fam 16x16的图标,默认的标签空间是在顶部/底部切断图像。
我试着通过改变边缘来搞乱图标的类,但它没有帮助。根据文档,ext.tab.Tab组件具有padding和height属性,但是设置这些属性在运行时不会对制表符产生影响。
Ext.define('AM.view.Tab.Standard', {
extend: 'Ext.tab.Panel',
alias: 'widget.TabStandard',
region: 'center', // a center region is ALWAYS required for border layout
deferredRender: false,
activeTab: 0, // first tab initially active
initComponent: function() {
this.items = this.buildItems();
this.callParent(arguments);
},
buildItems: function(){
var items =
[
{
padding: 10, // nope :(
title: 'Gantt',
autoScroll: true,
iconCls: 'gantt icon',
},
{
height: 10, // nope :(
title: 'Logs',
autoScroll: true,
iconCls: 'logs icon',
},
{
title: 'Help',
autoScroll: true,
iconCls: 'help icon',
}
];
return items
},
});
也许我误解了这些属性是如何工作的,但是页面上的所有内容看起来都是一样的。
编辑:它似乎我有同样的问题与"标题"(与+/-栏)当用作手风琴面板
您可以使用tabPanel:
的tabBar属性自定义选项卡面板中的选项卡var tabpanel = new Ext.tab.Panel({
plain: true,
region: 'center',
tabBar: {
defaults: {
flex: 1, // if you want them to stretch all the way
height: 20, // set the height
padding: 6 // set the padding
},
dock: 'top'
}
});