调整HorizontalPanel单元的大小 [英] Sizing a HorizontalPanel cell
问题描述
我一直在寻找一种方法来调整HorizontalPanel的特定单元格。
我想要做的是实现一个2单元的水平面板,并将左侧单元格设置为200px。然而,我试图让正确的单元格填充窗口的其余部分,而不是它的单元格内容。
我看不到树木,请帮忙.. 。
HorizontalPanel horizontalPanel = new HorizontalPanel();
horizontalPanel.setWidth(100%);
Widget widget1 = new Widget();
Widget widget2 = new Widget();
horizontalPanel.add(widget1);
horizontalPanel.add(widget2);
horizontalPanel.setCellWidth(widget1,200);
在上面的代码中,如果widget2的宽度设置为100%,那么widget2将填充窗口的其余部分。如果widget2的宽度不是100%,它不会填充窗口的其余部分。只需检查第二个单元格内容的宽度。它不应该是100%。
Newbie Alert:
I have been furiously looking for a way to size a particular cell of a HorizontalPanel.
What I am trying to do is implement a 2-cell Horizontal Panel and set the left cell to say 200px. However, I am trying to make the right cell fill the rest of the window, not its cells contents.
I cannot see the wood for the trees, please help...
HorizontalPanel horizontalPanel=new HorizontalPanel();
horizontalPanel.setWidth("100%");
Widget widget1=new Widget();
Widget widget2=new Widget();
horizontalPanel.add(widget1);
horizontalPanel.add(widget2);
horizontalPanel.setCellWidth(widget1,"200");
In above code if the widget2's width is set to 100% then widget2 will fill rest of the window.If the widget2's width is not 100% it will not fill rest of the window.Just check the width of your second cell content.It should not be 100%.
这篇关于调整HorizontalPanel单元的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!