2014-10-02 125 views
0

我有这个页面的xaml文件,它有一个标题面板和一个scrollViewer,它使用了标题面板左侧的屏幕高度。如何在Windows手机的页面中添加页脚面板?

我的问题是如何在屏幕底部添加页脚面板,以便scrollViewer只消耗页眉和页脚面板留下的高度?

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

回答

1

您现有的XAML标记看起来除了行定义部分罚款(定义为第三排,行放置页脚面板,丢失):

<Grid.RowDefinitions> 
    <RowDefinition Height="Auto"/> 
    <RowDefinition Height="*"/> 
    <RowDefinition Height="Auto"/> 
</Grid.RowDefinitions> 
相关问题