0
我在gwt應用程序中使用了一個LayoutPanel,其中包含兩個Button。 LayoutPanle的高度爲35px;而按鈕的高度爲25px;我想垂直對齊面板中間的按鈕。就像我已經嘗試過的那樣,沒有任何常見的造型方法似乎可以處理它。在面板造型或按鈕樣式上設置垂直對齊:中間,按鈕保持頂部對齊。在這種情況下,最終如何將按鈕置於中間,而不是在LayoutPanel中爲每個Button包裝一個HorizontalPanel並在HorizontalPanel上應用verticalAlignment?這是我在UiBinder的代碼:LayoutPanel中的垂直對齊
<g:LayoutPanel styleName="{style.buttonsBar}">
<g:layer left="30px" width="70px">
<g:Button ui:field="createButton" styleName="{style.crdelButton}">Create</g:Button>
</g:layer>
<g:layer right="30px" width="70px">
<g:Button ui:field="deleteButton" styleName="{style.crdelButton}">Delete</g:Button>
</g:layer>
</g:LayoutPanel>