更改 ExtJS 4 选项卡的高度
上下文:我正在编写一个 ExtJS 应用程序来帮助志愿者管理营地数据库。包含紧急信息、饮食要求和舱位分配。我希望它是用户友好的,以便志愿者能够快速掌握它,因此我决定标签需要更大,以引起人们对应用程序主要操作的关注。
问题:我只是不知道如何更改选项卡高度。
到目前为止的工作:
- 我尝试为我的选项卡面板设置 tabBar 属性,但选项卡没有调整大小,而且样式看起来很奇怪
- 我浏览了论坛,人们建议修改 CSS,但有没有例子
你能帮忙吗?这就是我想要实现的目标:
Context: I'm writing an ExtJS application to help volunteers manage a camp database. Containing emergency information, dietary requirements and cabin allocation. I want it to be user-friendly so that volunteers will pick it up quickly, so I decided the tabs need to be bigger to draw attention to the main actions of the application.
Problem: I just don't know how to change the tab height though.
Work so far:
- I've tried setting the tabBar property for my tab panel, but the tabs didn't resize and the styling just looked weird
- I looked through forums and people suggested modifying the CSS, but there were no examples
Can you help? This is what I want to acheive:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我想我已经找到解决方案了!
确保您已设置正在使用的 Ext.tab.Panel 的“cls”属性,然后将以下内容粘贴到自定义 CSS 文件中。
请注意,这会使选项卡变大并使文本居中对齐,但理想情况下图标也居中对齐。
I think I've found a solution!
Ensure you have set the 'cls' property of the Ext.tab.Panel you're using, then paste the following into your custom CSS file.
Note this makes the tabs bigger and middle-aligns the text, but ideally the icon would also be middle-aligned.
使用 带有 Compass 的新 ExtJS 4 主题,您只需
在
appname/resources/ 中 设置: sass/my-ext-theme.scss
。您将遇到的唯一问题是 标签栏下方的额外空间错误,在使用自定义主题时总是出现。但这可以很容易地解决,正如那里所解释的,通过设置你的 CSS 之一:
在 ExtJS 包中的
resources/themes/stylesheets/ext4/default/variables/_tabs.scss
文件中,你可以找到其他有用的变量来自定义选项卡大小和颜色。Using new ExtJS 4 theming with Compass you can just set:
in
appname/resources/sass/my-ext-theme.scss
.The only issue you will encounter is extra space below tab bar bug, which always appears when using custom theme. But this can be solved easily, as explained there, by setting in one of your CSS:
In
resources/themes/stylesheets/ext4/default/variables/_tabs.scss
file in ExtJS package, you can find other useful variables to customize tab size and color.如果您使用的是 extjs4,请使用 SASS 和 Compass 在 extjs 样式表中进行任何更改。
您可以在 my-custom-theme.scss 中添加以下变量来更改选项卡的高度:
If you are using extjs4 do use the SASS and Compass to make any changes in the extjs stylesheet.
You can just add below variable in my-custom-theme.scss to change the height of the tab: