Xaml 如何将网格填充到windows';她身高多少?

Xaml 如何将网格填充到windows';她身高多少?,xaml,grid,uwp,Xaml,Grid,Uwp,这是我的页面的模板: 如果我没弄错的话,你会想要一个像页脚这样的东西,不管你的窗口看起来是什么样子,它总是在底部。对吗 如果是这样,这可能是您的解决方案: <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <Ro

这是我的页面的模板:



如果我没弄错的话,你会想要一个像页脚这样的东西,不管你的窗口看起来是什么样子,它总是在底部。对吗

如果是这样,这可能是您的解决方案:

<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto" />
        <RowDefinition Height="*" />
        <RowDefinition Height="Auto" />
    </Grid.RowDefinitions>

    <!--  Header  -->
    <Grid Grid.Row="0">
        <!--  Place all header here  -->
    </Grid>

    <!--  Content  -->
    <Grid Grid.Row="1">
        <!--  Place all your scrollable elements here  -->
    </Grid>

    <!--  Footer  -->
    <Grid Grid.Row="2">
        <!--  Place everything that needs to stay at the bottom here  -->
    </Grid>
</Grid>

通过定义
元素,您可以为子元素提供特殊的高度,如
Auto
(根据需要占用空间)和
*
(占用剩余空间)


这就是你需要的吗?

关闭。我想设计没有页脚的页面。根网格应该在“还原向下”模式下填充到窗口,填充方式与在“全尺寸”模式下(滚动显示区域)相同,但没有发生。我不明白。你能画我吗,你到底是什么意思?你想看什么?始终占据您窗口100%的视图?默认情况下,
网格
会这样做。在网格内,您可以用
行定义“填充”。您看到我在第一条消息中共享的屏幕了吗?首先,yoa可以看到列表后的按钮和文本框。在第二个底部部分是隐藏和滚动条不工作是的,但我不明白,你们的目标是什么?您想要a)始终位于页面底部的
TextBox
,还是b)始终位于列表底部的
TextBox
,可能需要多长时间(当然可以滚动)。你想要b),对吗?
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto" />
        <RowDefinition Height="*" />
        <RowDefinition Height="Auto" />
    </Grid.RowDefinitions>

    <!--  Header  -->
    <Grid Grid.Row="0">
        <!--  Place all header here  -->
    </Grid>

    <!--  Content  -->
    <Grid Grid.Row="1">
        <!--  Place all your scrollable elements here  -->
    </Grid>

    <!--  Footer  -->
    <Grid Grid.Row="2">
        <!--  Place everything that needs to stay at the bottom here  -->
    </Grid>
</Grid>