2013-12-19 63 views
0

如果有人可以幫助我,那將會很棒。我目前有一個電話頁面,我想顯示圖像,但不知何故,我的scrollviewer不滾動到底部,我只能看到兩行圖像,之後,scrollviewer不再進一步。 這是我的XAML:scrollviewer does not scroll to bottom

<ScrollViewer x:Name="Details"> 
        <Grid> 
         <Grid.ColumnDefinitions> 
          <ColumnDefinition Width="3*"/> 
          <ColumnDefinition/> 
         </Grid.ColumnDefinitions> 
         <Grid.RowDefinitions> 
          <RowDefinition/> 
          <RowDefinition/> 
          <RowDefinition/> 
          <RowDefinition/> 
          <RowDefinition/> 
          <RowDefinition/> 
          <RowDefinition/> 
          <RowDefinition/> 
          <RowDefinition/> 
          <RowDefinition/> 
          <RowDefinition/> 
         </Grid.RowDefinitions> 
         <Rectangle Fill="Black" Opacity="0.5" Grid.ColumnSpan="2" Grid.RowSpan="8"/> 
         <StackPanel Margin="15,10,1,0" Grid.Column="0" Grid.Row="0"> 
          <TextBlock Text="{Binding xxx.Address}" Foreground="White" FontSize="22" FontWeight="Bold" /> 
          <TextBlock Foreground="White"> 
         <Run Text="{Binding xxx.Zipcode}" /> 
         <Run /> 
         <Run Text="{Binding xxx.Location}" /> 
          </TextBlock> 
         </StackPanel> 
         <Image Source="/Assets/xxx.png" Height="50" Grid.Column="1" Grid.Row="0" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,15,0,0" /> 
         <StackPanel Grid.Row="2"> 
          <TextBlock Text="{Binding xxxx.xxx}" Foreground="White" MinHeight="50" TextWrapping="Wrap" VerticalAlignment="Center" HorizontalAlignment="Left" FontWeight="Bold" Margin="15,10,1,0" FontSize="22" /> 
          <TextBlock Text="xxxx" Foreground="White" TextWrapping="Wrap" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="15,0,1,10" /> 
         </StackPanel> 
         <Image Source="/Assets/xxx.png" Grid.Row="2" Grid.Column="1" Height="50" Margin="10" /> 
         <TextBlock Text="xxx:" Margin="15,10,1,0" Foreground="#FFD8051E" Grid.Column="0" Grid.Row="3"/> 
         <TextBlock Text="xxxx:" Margin="15,10,1,0" Grid.Column="0" Grid.Row="4" /> 
         <TextBlock Margin="15,10,1,0" Grid.Column="1" Grid.Row="4" > 
          <Run Text="{Binding xxx}" /> 
          <Run Text=" m" /> 
         </TextBlock> 
         <TextBlock Text="xxxx:" Margin="15,10,1,0" Grid.Column="0" Grid.Row="5" /> 
         <TextBlock Text="{Binding xxxx}" Margin="15,10,1,0" Grid.Column="1" Grid.Row="5" /> 
         <TextBlock Text="xxxx:" Margin="15,10,1,0" Grid.Column="0" Grid.Row="6" /> 
         <ItemsControl Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="7" ItemsSource="{Binding xxxx}"> 
          <ItemsControl.ItemsPanel> 
           <ItemsPanelTemplate> 
            <tool:WrapPanel /> 
           </ItemsPanelTemplate> 
          </ItemsControl.ItemsPanel> 
          <ItemsControl.ItemTemplate> 
           <DataTemplate> 
            <Image Margin="10" Source="{Binding .,Converter={StaticResource xxxxx}}" Height="100" Width="100" HorizontalAlignment="Left" VerticalAlignment="Top"/> 
           </DataTemplate> 
          </ItemsControl.ItemTemplate> 
         </ItemsControl> 
        </Grid> 
       </ScrollViewer> 
+0

什麼是包含在你的ScrollViewer? – user3007447

回答

0

我認爲這個問題是在你的ScrollViewer屬性。

應該有一些更清晰

<ScrollViewer Grid.Row="1" 
Name="Details" 
VerticalScrollBarVisibility="Visible" AllowDrop="False" ManipulationMode="Control"> 
+0

由於沒有完整的XML代碼。我建議你試試這個。只是嘗試第1 VerticalScrollBarVisibility =「可見」屬性 – Kirk

+0

感謝您的回答,但大多數這些屬性是自動設置。我添加了ManipulationMode =「Control」屬性並進行了測試,以確保其他屬性也一樣,但不起作用。此外,我添加verticalscrollbar的可見性,並將其設置爲可見,但沒有運氣 – machie27

+0

嘗試此ScrollViewer.VerticalScrollBarVisibility =「禁用」,如果它不工作,然後嘗試ScrollViewer.VerticalScrollBarVisibility =「自動」。因爲我不能假設正確的答案,因爲我沒有嘗試模擬樣本。但這些問題大多發生 – Kirk