固定面板位于屏幕底部

时间:2017-12-08 08:51:13

标签: xaml windows-10 visual-studio-2017

嗨,我试图在屏幕底部有两个浮动按钮。现在我实现以下代码:

<ScrollViewer>
<RelativePanel>
// Main Content here
<StackPanel RelativePanel.AlignBottomWithPanel="True" >Two buttons appears at the bottom of the PAGE (not screen)</StackPanel>
</RelativePanel>
</ScrollViewer>

正如您所料,按钮显示在页面底部。我希望按钮出现在屏幕的底部。

XAML中是否有任何可用于实现的面板:

====================
  Scrollable area

=====================
Button1       Button2
----------------------
  1. 可滚动的内容区域
  2. 以及可滚动区域下方的面板,该面板粘在屏幕底部,不会飞到屏幕上方。

1 个答案:

答案 0 :(得分:0)

你可以试试这个,

        <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="50"/>
        </Grid.RowDefinitions>

        <ScrollViewer Grid.Row="0">

        </ScrollViewer>

        <StackPanel Grid.Row="1" Orientation="Horizontal">
            <Button/>
            <Button/>
        </StackPanel>   </Grid>

希望这会对你有所帮助。如果有帮助,请将其标记为答案。

相关问题