有没有办法在 xaml 中创建粘性页脚?

发布于 2024-09-18 06:41:59 字数 92 浏览 3 评论 0原文

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

I know you can do a sticky footer in css, is there any way to do it in xaml? Or to use css in xaml to do the same thing? I'm brand new to xaml, so any help would be appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

鲜肉鲜肉永远不皱 2024-09-25 06:42:04

我会选择网格,因为我发现如果您的布局发生变化或添加更多控件,它们更容易扩展:

<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>

有一个不错的教程 这里

I'd opt for a Grid as I find them easier to extend if your layout changes or you add more controls:

<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>

There's a decent tutorial here

甜尕妞 2024-09-25 06:42:03

可以使用 DockPanel 来完成。

It can be done using DockPanels.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文