如何让 TabBox 填满所有可用空间?
有谁知道我如何使 TabBox 填充所有可用空间? 我尝试了这个:
<tabbox id="MyTabBox" flex="1">
<tabs>
<tab label="Income" />
<tab label="Taxes" />
</tabs>
<tabpanels flex="1">
<tabpanel>
<button label="Calculate" flex="0"/>
</tabpanel>
<tabpanel>
</tabpanel>
</tabpanels>
</tabbox>
TabBox 看起来不错,但这使得 Button 填充第一个 TabPanel 的所有高度,尽管它具有 flex 属性。 如果我限制 Button 的高度,这也会使 TabBox 有点短,而不是我需要的方式。
谢谢。
更新:窗口代码现在如下所示:
<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="chrome://global/skin/" ?>
<?xml-stylesheet type="text/css" href="chrome://MyExtension/skin/MyExtension.css" ?>
<!DOCTYPE window SYSTEM "chrome://MyExtension/locale/translations.dtd">
<window id="MyExtension-MainWindow"
title="My Extension"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml">
<html:link rel="icon" href="chrome://MyExtension/skin/MyExtensionFavIcon.png"/>
<tabbox id="MyTabBox" flex="1">
<tabs>
<tab label="Income" />
<tab label="Taxes" />
</tabs>
<tabpanels flex="1">
<tabpanel align="start">
<button label="Calculate" flex="0"/>
</tabpanel>
<tabpanel>
</tabpanel>
</tabpanels>
</tabbox>
</window>
FavIcon 正常,按钮正常,TabBox 缩小,这很糟糕:-(
Does anybody know how I can make TabBox to fill all available space?
I tried this:
<tabbox id="MyTabBox" flex="1">
<tabs>
<tab label="Income" />
<tab label="Taxes" />
</tabs>
<tabpanels flex="1">
<tabpanel>
<button label="Calculate" flex="0"/>
</tabpanel>
<tabpanel>
</tabpanel>
</tabpanels>
</tabbox>
The TabBox looks fine, but this makes the Button to fill all the height of the first TabPanel, despite its flex attribute.
If I limit the height of the Button, that also makes the TabBox kind of short, not the way I need.
Thank you.
Update: The window code now looks like this:
<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="chrome://global/skin/" ?>
<?xml-stylesheet type="text/css" href="chrome://MyExtension/skin/MyExtension.css" ?>
<!DOCTYPE window SYSTEM "chrome://MyExtension/locale/translations.dtd">
<window id="MyExtension-MainWindow"
title="My Extension"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml">
<html:link rel="icon" href="chrome://MyExtension/skin/MyExtensionFavIcon.png"/>
<tabbox id="MyTabBox" flex="1">
<tabs>
<tab label="Income" />
<tab label="Taxes" />
</tabs>
<tabpanels flex="1">
<tabpanel align="start">
<button label="Calculate" flex="0"/>
</tabpanel>
<tabpanel>
</tabpanel>
</tabpanels>
</tabbox>
</window>
FavIcon is Ok, Button is Ok, TabBox is shrunk, which sucks :-(
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试将
align="center"
添加到button选项卡面板(将align
添加到元素会影响该元素的子元素,而不是元素本身)。请参阅此处 - IIRCstretch
是默认值。Try adding
align="center"
to thebuttontabpanel (Addingalign
to an element affects that element's children, not the element itself). See here -- IIRCstretch
is the default.