【问题标题】:Is there any way to create a sticky footer in xaml?有没有办法在 xaml 中创建粘性页脚?
【发布时间】:2011-04-09 21:18:52
【问题描述】:

我知道你可以在 css 中做一个粘性页脚,有没有办法在 xaml 中做到这一点?或者在 xaml 中使用 css 来做同样的事情?我是 xaml 的新手,因此我们将不胜感激。

【问题讨论】:

标签: xaml footer sticky


【解决方案1】:

可以使用 DockPanel 来完成。

【讨论】:

  • 更好的方法是使用网格布局并在每个单元格中设置垂直对齐方式。
【解决方案2】:

我会选择 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

【讨论】:

  • 这不是粘性页脚,这是底部的固定页脚。
猜你喜欢
  • 2021-04-23
  • 2011-01-11
  • 1970-01-01
  • 2018-08-13
  • 2012-12-28
  • 2012-12-31
  • 1970-01-01
  • 2020-08-20
  • 1970-01-01
相关资源
最近更新 更多