1 回答

TA貢獻1876條經驗 獲得超5個贊
如果您的預期輸出是這樣的:
--------------------------------------
| [Geo Button] |
| [Text Block] |
| [Flat Button]|
| [Flat Button]|
--------------------------------------
然后你需要Orientation將Vertical改為Horizontal。
但是,如果您想要這樣:
--------------------------------------
| [Geo Button] [Flat Button]|
| [Text Block] [Flat Button]|
--------------------------------------
它是:
更改 的 ,Margin同時Flat Button仍然使用上面的代碼(我個人不推薦這樣做);或者
使用Grid或DockPanel,嘗試在此處查找代碼和更多說明
我部分地實現了您的預期輸出:
<Grid Height="100" Background="Red">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal" Grid.Column="0">
//...
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Column="1" HorizontalAlignment="Right">
//...
</StackPanel>
</Grid>
部分地,因為我沒有FlatButton和 的資源Geo Button,所以我只使用了常規的Button。請注意,您需要將VerticalAlignment屬性設置為Centerfor <TextBlock>。
- 1 回答
- 0 關注
- 197 瀏覽
添加回答
舉報