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