简体   繁体   中英

How can I add a footer panel in my page in Windows phone?

I have this page xaml file, which has a header panel and a scrollViewer which uses up the height of the screen left by the header panel.

My question is how can I add a footer panel at the bottom of the screen so that the scrollViewer just uses up the height left by both header and footer panels?

<Page>
    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!-- Header Panel -->
        <StackPanel Grid.Row="0" Margin="19,0,0,0">
            <TextBlock x:Uid="Header" Text="MyApplication" Margin="0,12,0,0"/>
            <TextBlock Text="{Binding Title}" Margin="0,-6.5,0,26.5" CharacterSpacing="{ThemeResource PivotHeaderItemCharacterSpacing}" />
        </StackPanel>


         <!-- Content Panel -->
         <ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">

            <<ItemsControl ItemsSource="{Binding MyCollection}" />
        </ScrollViewer>

        <!-- Footer Panel -->
        <StackPanel Grid.Row="2" Margin="19,0,0,0">
            <TextBlock x:Uid="Header" Text="Footer"  Margin="0,12,0,0"/>
            <TextBlock Text="{Binding Title}" Margin="0,-6.5,0,26.5" />
        </StackPanel>
    </Grid>
</Page>

Your existing XAML markup looks fine except row definitions part (definition for the 3rd row, the row to place footer panel, missing) :

<Grid.RowDefinitions>
    <RowDefinition Height="Auto"/>
    <RowDefinition Height="*"/>
    <RowDefinition Height="Auto"/>
</Grid.RowDefinitions>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM