【发布时间】:2011-04-09 21:18:52
【问题描述】:
我知道你可以在 css 中做一个粘性页脚,有没有办法在 xaml 中做到这一点?或者在 xaml 中使用 css 来做同样的事情?我是 xaml 的新手,因此我们将不胜感激。
【问题讨论】:
我知道你可以在 css 中做一个粘性页脚,有没有办法在 xaml 中做到这一点?或者在 xaml 中使用 css 来做同样的事情?我是 xaml 的新手,因此我们将不胜感激。
【问题讨论】:
可以使用 DockPanel 来完成。
【讨论】:
我会选择 Grid,因为如果您的布局更改或添加更多控件,我发现它们更容易扩展:
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Label Grid.Row="0" Grid.Column="0" Content="Label at the top"/>
<Label Grid.Row="0" Grid.Column="0" Content="Label at the bottom"/>
</Grid>
有一个不错的教程here
【讨论】: