uwp - UWP 垂直排列底部项目(拆分视图)
解决方案
我将使用Grid
具有以下布局的 a 来实现它:
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" x:Name="SecondColumn" />
<ColumnDefinition Width="Auto" x:Name="ThirdColumn" />
</Grid.ColumnDefinitions>
...
</Grid>
现在使用PaneClosing
andPaneOpening
事件来适当地更改按钮的Grid.Column
andGrid.Row
值。
所以当窗格打开时,我会设置:
Grid.Row
三个按钮都为 0Grid.Column
分别为 0、1、2SecondColumn.Width
并ThirdColumn.Width
_new GridLength(1, GridUnitType.Star)
关闭时:
Grid.Row
分别为 0、1、2Grid.Column
三个按钮都为 0SecondColumn.Width
并ThirdColumn.Width
_new GridLength(0)
替代解决方案是使用 a并在and之间StackPanel
切换,尽管这不会将按钮彼此相邻 - 要添加空格,您也必须修改按钮的 。Orientation
Horizontal
Vertical
Margin
推荐阅读
- javascript - 使用 React 应用程序不会立即在 Safari 上加载图像
- python-3.x - 如何更新数据类python的值
- python - 类型错误位置参数自我丢失
- graph - 如何导出或检索主图表/图表中显示的 Google Adwords 数据?
- apache-kafka - KSQL 是否支持 Kafka 流处理保证?
- javascript - 如何只允许一个具有特定类的元素
- bash - 如何对bash中任何命令的非零返回码执行操作
- tfs - 如何查询没有父功能链接的故事?
- html - 如何在 React.js 中将日期显示为 mm/dd/yyyy 而没有时间
- android - 由于无法删除文件,项目不断无法清理