gpt4 book ai didi

javascript - 更改高度或向 EXTjs ext.tab.Tab 组件添加填充

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:21:27 25 4
gpt4 key购买 nike

我有一个选项卡面板,里面有几个选项卡。我在选项卡中使用 iconCls 属性为每个选项卡提供图像及其标题。我正在使用 fam fam fam 16x16 icons并且默认的制表符空间在顶部/底部切断图像。

我尝试通过更改边距来弄乱图标的类,但它没有帮助。根据文档,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
},
});

也许我误解了这些属性的工作原理,但页面上的所有内容看起来都一样。

编辑:当用作 Accordion 面板时,我似乎遇到了与“标题”(带有 +/- 的栏)相同的问题。

最佳答案

您可以使用 tabBar 在选项卡面板中自定义选项卡tabPanel 上的属性:

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'
}

});

关于javascript - 更改高度或向 EXTjs ext.tab.Tab 组件添加填充,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7112170/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com