2011-11-16 13 views
1

如何在Silverlight for Windows Phone 7中製作靜態和滾動元素。如何在Silverlight for Windows Phone 7中製作靜態和滾動元素?

我用下面的代碼,但與靜態組件一些問題,即靜態組件還滾動

我的代碼:

<Grid x:Name="LayoutRoot" Background="Transparent"> 
     <Grid.RowDefinitions> 
      <RowDefinition Height="100"/> 
      <RowDefinition Height="700"/> 
     </Grid.RowDefinitions> 



     <!--ContentPanel - place additional content here--> 
     <Grid x:Name="ContentPanel" Grid.Row="1"> 
      <Image Source="top_1.png"></Image> 
     </Grid> 
     <Grid x:Name="ContentPane2" Grid.Row="2"> 
      <ScrollViewer> 
       <Image Source="down_1.png"></Image> 
      </ScrollViewer> 
     </Grid> 
    </Grid> 

回答

3

的Grid.Row屬性是從零開始的。您需要將您的xaml更改爲以下內容:

<Grid x:Name="ContentPanel" Grid.Row="0"> 
    <Image Source="top_1.png"></Image> 
</Grid> 
<Grid x:Name="ContentPane2" Grid.Row="1"> 
    <ScrollViewer> 
     <Image Source="down_1.png"></Image> 
    </ScrollViewer> 
</Grid> 
相關問題