更改选项卡面板上的标签宽度(Changing tab width on tab panel)

系统教程 行业动态 更新时间:2024-06-14 17:03:54
更改选项卡面板上的标签宽度(Changing tab width on tab panel)

我正在用Sencha-touch编写应用程序。 我在标签面板中有3个标签。 我希望每个人占据选项卡面板宽度的33%。 我尝试过使用resizeTabs , tabWidth ,甚至为每个项添加了一个类,然后在css中引用它来更改宽度。

然后我也尝试在html中使用span元素并引用它。 但它都不起作用。 我的代码如下。 如何更改选项卡面板中选项卡的宽度?

{ xtype: 'tabpanel', fullscreen: true, tabBarPosition: 'top', resizeTabs: true, tabWidth: '33%', items:[ { //title: 'Campus List', html: '<span class="headerTab">Campus List</span>', width: '33%', cls: 'headerTab' }, { title: 'Meter List', html: 'Meter List', width: '33%', cls: 'headerTab' }, { title: 'Meter', html: 'Meter', width: '33%', cls: 'headerTab' } ] }

I'm writing an app in Sencha-touch. I have 3 tabs in a tab panel. I'd like each one to take up 33% of the width of the tab panel. I've tried using resizeTabs, tabWidth, and even added a class to each item and then referenced it in css to change the width.

Then I also tried using a span element in the html and referencing that. But none of it works. My code is below. How do I change the width of the tabs in a tab panel?

{ xtype: 'tabpanel', fullscreen: true, tabBarPosition: 'top', resizeTabs: true, tabWidth: '33%', items:[ { //title: 'Campus List', html: '<span class="headerTab">Campus List</span>', width: '33%', cls: 'headerTab' }, { title: 'Meter List', html: 'Meter List', width: '33%', cls: 'headerTab' }, { title: 'Meter', html: 'Meter', width: '33%', cls: 'headerTab' } ] }

最满意答案

我想到了。 如果您在css中引用选项卡的xtype而不是tabpanel,那么它将调整选项卡的大小。 这是有效的。

.x-tab{ width: 33%; }

I figured it out. If you reference the xtype of the tab, not the tabpanel, in your css then it will resize the tabs. Here's what worked.

.x-tab{ width: 33%; }

更多推荐

本文发布于:2023-04-24 14:20:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/dzcp/96be8fac751df4ebcc2aa00245a1ea6c.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:宽度   选项卡   板上   标签   panel

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!