我在GWT中正確對齊DecoratorPanel
中的內容時出現問題。垂直瓦片GWT面板
使用下面的代碼片段,所有內容似乎是垂直對齊到中間
DecoratorPanel decor = new DecoratorPanel();
decor.setHeight("100%");
decor.add(new Label("Test"));
圖來解釋(?):
-------- --------
I get this: | | I want this: |test |
| | | |
|test | | |
| | | |
| | | |
-------- --------
我已經試過decor.getElement().getStyle().setVerticalAlign(VerticalAlign.TOP);
,但它確實似乎沒有影響任何東西。
如何將內容與面板頂部對齊?
更新:
我有通知,如果我用一個LayoutPanel
代替DecorPanel
一切似乎正確對齊。
難道問題是我正在使用常規和LayoutPanels
?如果是這樣,爲什麼我有問題?