2014-04-07 2 views
1

xaml이 내 것이 아닙니다. 제목은 그것을 모두 말합니다.Windows Phone 8에서 ScrollViewer가 스크롤하지 않습니다.

<phone:Panorama Title="MSFT Insider" Background="#FFD8D8D8" Foreground="Black" Style="{StaticResource PanoramaStyle1}"> 

      <!--Elemento Panorama uno--> 
      <phone:PanoramaItem Header="Portada" FontSize="20"> 
       <StackPanel HorizontalAlignment="Left" Width="416"> 
        <ScrollViewer Height="Auto" Width="416" HorizontalAlignment="Left" VerticalAlignment="Top" VerticalScrollBarVisibility="Auto"> 

         <ListBox x:Name="frontpost_list" Width="416" Height="Auto" Margin="0,0,0,0" VerticalAlignment="Top" ScrollViewer.VerticalScrollBarVisibility="Hidden" ScrollViewer.HorizontalScrollBarVisibility="Hidden"> 
           <ListBox.ItemTemplate> 
            <DataTemplate> 
            <StackPanel HorizontalAlignment="Left" Height="Auto" VerticalAlignment="Top" Width="416"> 
             <Grid Width="415" Height="240"> 
              <Image Source="Assets/PanoramaBackground.png" Stretch="UniformToFill" Height="240" Width="415"/> 
              <TextBlock VerticalAlignment="Bottom" FontSize="29.333" FontWeight="Bold" Margin="10,0,10,20" UseLayoutRounding="True" Padding="0" TextWrapping="Wrap" TextTrimming="WordEllipsis" Text="{Binding Title}" FontFamily="Arial" CharacterSpacing="1" Foreground="Black"/> 
             </Grid> 
            </StackPanel> 
           </DataTemplate> 
           </ListBox.ItemTemplate> 
          </ListBox> 
        </ScrollViewer> 
       </StackPanel> 
       <!--Lista de una línea con ajuste automático de texto--> 
      </phone:PanoramaItem> 

화면이 자동으로 이전 위치로 돌아가고 스크롤이 완료되지 않습니다. 그냥 아래로 이동하고 다시 탄성보다.

ScrollViewer가 스크롤되지 않고 ScrollViewer 내부의 요소는 ScrollViewer가 포함 된 StackPanel보다 긴 것입니다. 스크롤하려고하면 튀어 오릅니다.

감사합니다.

답변

2

편집 내 대답. VS에서 이것을 시도하고 오류를 발견했습니다. ListBox에는 ScrollViewer이 전혀 필요하지 않으며 사용자는 Height="Auto"입니다. 즉, ListBox를 필요한 높이로 확장하여 스크롤 가능성을 비활성화합니다. 또한 DataTemplate 내부에 StackPanel과 Grid가 둘 다 필요하지 않습니다.

<phone:PanoramaItem Header="Portada" FontSize="20"> 
      <StackPanel HorizontalAlignment="Left" Width="416"> 
        <ListBox x:Name="frontpost_list" Width="416" Height="400" Margin="0,0,0,0"> //Notice the height 
         <ListBox.ItemTemplate> 
          <DataTemplate> 
           <StackPanel HorizontalAlignment="Left" Height="Auto" VerticalAlignment="Top" Width="416"> 
            <Image Source="Assets/PanoramaBackground.png" Stretch="UniformToFill" Height="240" Width="415"/> 
            <TextBlock VerticalAlignment="Bottom" FontSize="29.333" FontWeight="Bold" Margin="10,0,10,20" UseLayoutRounding="True" Padding="0" TextWrapping="Wrap" TextTrimming="WordEllipsis" Text="{Binding Title}" FontFamily="Arial" CharacterSpacing="1" Foreground="Black"/> 
           </StackPanel> 
          </DataTemplate> 
         </ListBox.ItemTemplate> 
        </ListBox> 
      </StackPanel> 
      <!--Lista de una línea con ajuste automático de texto--> 
     </phone:PanoramaItem> 
+0

감사합니다. 문제가 해결되지 않습니다. – Adelaiglesia

+0

스크롤하려는 요소는 무엇입니까? – Sopuli

+0

"frontpost_list"목록 상자 – Adelaiglesia

관련 문제