问题描述
TabLayoutPanel的简单示例仅显示容器小部件Tab项是可见的。有些东西出错了,它适用于IE8
public class DemoGWT implements EntryPoint {
RootPanel rp = RootPanel 。得到();
$ b $ public void onModuleLoad(){
TabLayoutPanel panel = new TabLayoutPanel(25,Unit.PX);
标签a =新标签(一个容器);
panel.add(a,One Hdr);
panel.add(新标签(Two Container),Two Hdr);
panel.add(新标签(Three Container),Three Hdr);
panel.add(新标签(Four Container),Four Hdr);
panel.add(新标签(Five Container),Five Hdr);
panel.add(新标签(Six Container),Six Hdr);
rp.add(面板);
}
}
Don不会混淆布局面板和面板。当您使用布局面板(如TabLayoutPanel)时,请确保其父级及其父级达到RootPanel是布局面板。使用 RootLayoutPanel 而不是 RootPanel 。除非你提到它的绝对高度,否则TabLayoutPanel将不显示数据。 (注意100%或其他任何%都不起作用)。
将 RootPanel 更改为 RootLayoutPanel 并使用 TabLayoutPanel 的 setHeight(height) API。 不要提及年龄高度。
Simple example of TabLayoutPanel not showing container widgets only Tab items are visible.Something going wrong is it works for IE8
public class DemoGWT implements EntryPoint { RootPanel rp = RootPanel.get(); public void onModuleLoad() { TabLayoutPanel panel = new TabLayoutPanel(25, Unit.PX); Label a = new Label("One Container"); panel.add(a, "One Hdr"); panel.add(new Label("Two Container"), "Two Hdr"); panel.add(new Label("Three Container"), "Three Hdr"); panel.add(new Label("Four Container"), "Four Hdr"); panel.add(new Label("Five Container"), "Five Hdr"); panel.add(new Label("Six Container"), "Six Hdr"); rp.add(panel); } }
Don't mix up Layout panels and panels. When you use layout panels such as TabLayoutPanel, Make sure its parent and their parent upto RootPanel are layout panels. Use RootLayoutPanel instead of RootPanel. TabLayoutPanel will not display data unless you mention its absolute height. (Note 100% or any other % won't work). It has to be absolute.
Change the RootPanel to RootLayoutPanel and use setHeight(height) API of your TabLayoutPanel. Don't mention height in %age.
这篇关于TabLayoutPanel仅显示小部件选项卡项目可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!