2014-10-02 50 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> 
相關問題