VerticalPanel面板= new VerticalPanel(); panel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
上面的内容并没有与我添加到此面板的Tree小部件对齐。关于如何保持对齐Tree小部件的任何想法?
答案 0 :(得分:2)
我认为任何组件的默认对齐方式是left
对齐:)(如果我错了,请纠正我。)无论如何,这里是:
panel.setCellHorizontalAlignment(treeWidget, HasHorizontalAlignment.ALIGN_LEFT);
您也可以在UiBinder
中执行此操作:
<g:cell horizontalAlignment="ALIGN_LEFT">
<g:VerticalPanel>
...
</g:VerticalPanel>
</g:cell>
答案 1 :(得分:0)
尝试
panel.setHorizontalAlignment(HasAlignment.ALIGN_LEFT)
;