3
A
回答
1
不自动。你必须告诉TabLayoutPanel
它应该有多大 - 或者让它的父窗口部件这样做。如果没有自定义代码,孩子们不能告诉它有多大。
1
我已经创建了一个小的解决方法 - 我已经足以在添加所有选项卡后删除选项卡容器中的溢出。
// Tabs are hidden because of overflow setting. Remove overflow &
// relative positioning from the tab widget.
for (int i = 0; i < tabLayout.getWidgetCount(); i++) {
final Widget widget = tabLayout.getWidget(i);
DOM.setStyleAttribute(widget.getElement(), "position", "relative");
final Element parent = DOM.getParent(widget.getElement());
DOM.setStyleAttribute(parent, "overflowX", "visible");
DOM.setStyleAttribute(parent, "overflowY", "visible");
}
PS .:在创建TabLayoutPanel以便与IE兼容时使用PX单元,否则标签导航可能不可见。
致以问候
波格丹。
1
您可以改为使用DecoratedTabPanel。而没有解决办法将是必要的
的Java ...
VerticalPanel tab1 = new VerticalPanel();
VerticalPanel tab2 = new VerticalPanel();
VerticalPanel tab3 = new VerticalPanel();
DecoratedTabPanel tabPanel = new DecoratedTabPanel();
tabPanel.add(tab1);
tabPanel.add(tab2);
tabPanel.add(tab3);
...
CSS
.gwt-DecoratedTabBar {
padding-top: 4px;
padding-right: 14px;
padding-left: 4px;
padding-bottom: 0;
cursor: default;
color: #7a7a7a;
font-weight: bold;
text-align: center;
background: #fafafa;
}
/** The tab bar items the users click on*/
.gwt-DecoratedTabBar .gwt-TabBarItem {
border-top-left-radius: 6px;
border-top-right-radius: 6px;
cursor: pointer;
padding-top: 3px;
padding-right: 10px;
padding-left: 10px;
padding-bottom: 5px;
background: #fff;
color: #7a7a7a;
margin-right: 3px;
}
/** The tab bar items the users click on - selected version*/
.gwt-DecoratedTabBar .gwt-TabBarItem-selected {
border-top-left-radius: 6px;
border-top-right-radius: 6px;
cursor: pointer;
padding-top: 3px;
padding-right: 10px;
padding-left: 10px;
padding-bottom: 5px;
background: #1d6bbb;
color: #fff;
}
/** the body of the tab*/
.gwt-TabPanelBottom {
border-top: 3px solid #1d6bbb;
border-top-left-radius: 6px;
border-top-right-radius: 6px;
padding: 6px;
background: #fff;
}
+0
DecoratedTabPanel仅适用于怪癖模式。 –
1
你可以使用DecoratedTabPanel代替,因为它动态地改变大小根据其孩子小部件的tabpanel。
DecoratedTabPanel dtp = new DecoratedTabPanel();
dtp.add(widget, title)
dtp.selectTab(0);
相关问题
- 1. Flash动态调整大小
- 2. Bootstrap动态调整大小
- 3. iFrame动态调整大小
- 4. $ .dialogue()动态调整大小
- 5. SVG动态调整大小
- 6. 动态调整动态iframe的大小
- 7. 获取模态以在窗口大小调整时动态调整大小
- 8. JavaFX 2窗格动态调整大小
- 9. 动态调整图像大小。
- 10. SSRS动态列大小调整
- 11. 统一调整大小下拉动态
- 12. C++调整动态数组大小
- 13. C#DataViusalization图动态调整大小
- 14. 调整动态数组的大小
- 15. 动态调整iframe的大小
- 16. 动态调整UILabel的内容大小
- 17. CSS图像动态调整大小
- 18. 动态图像大小调整
- 19. Cocoa-Touch:动态调整视图大小
- 20. 动态调整大小闪亮textAreaInput框?
- 21. 使调整大小的元素动态
- 22. 动态JPanel调整大小问题
- 23. 动态调整列大小在.Rprofile
- 24. 动态调整UITableView高度的大小
- 25. 动态调整Flotr2图表的大小
- 26. 用MPlayer和PyGTK动态调整大小
- 27. 的iFrame模式动态调整大小
- 28. Android OpenGL动态调整大小FloatBuffer?
- 29. css div液态/自动调整大小
- 30. JQuery:动态图像调整大小
谢谢Bogdan!有用 ! 但我在代码中添加了以下代码:'DOM.setStyleAttribute(parent,“position”,“relative”);' – mji