2011-12-20 3 views
3

내 프로젝트에서 ScrollViewer를 사용하여 일부 긴 정보를 표시합니다.WP7 ScrollViewer 버그 콘텐츠 높이> 2000px

나는 다음과 같이 사용합니다

<Grid Grid.Row="1" Height="630"> 
    <ScrollViewer Background="Red" Grid.Row="1"> 
     <Grid> 
      <Rectangle Height="3000" Fill="LightBlue" Width="440"/> 
      </Grid> 
    </ScrollViewer> 
</Grid> 

그러나, 불행하게도 rectagnle가 완전히 표시되지 않는 경우있는 ScrollView 막대의 수직 높이> 2000

난 단지와 함께,에서 ScrollViewer의 내용으로 그리드없이 테스트 한 Rectangle 결과는 같습니다.

그리고 너비에 버그가 발생합니다.

어떤 해결 방법이 있습니까? 어떻게 처리할까요?

post은 수정하지 않고 동일한 문제입니다.

고맙습니다. ... 지미


시험 전체 XAML은 다음과 같습니다 scrollable textblock :

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

    <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28"> 
     <TextBlock x:Name="ApplicationTitle" Text="MY APPLICATION" Style="{StaticResource PhoneTextNormalStyle}"/> 
     <TextBlock x:Name="PageTitle" Text="page name" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/> 
    </StackPanel> 

    <Grid Grid.Row="1" Height="630"> 
     <ScrollViewer Background="Red" Grid.Row="1"> 
      <Grid> 
       <Rectangle Height="3000" Fill="LightBlue" Width="440"/> 
      </Grid> 
     </ScrollViewer> 
    </Grid> 
</Grid> 

답변

3

그냥 텍스트,이 사용자 지정 컨트롤을 사용할 수 있다면. 그렇지 않으면, 크기의 블록으로 콘텐츠를 분할 < 2048

UPD :

2048 픽셀은 GPU의 캐시 그래픽의 한계입니다. scrollviewer 안에 많은 컨트롤 (< 2048)을 사용할 수 있습니다 (총> 2048). 어떤 경우에는 모든 괜찮지 만, 일부는

예를 들어

하지 않는다 : 다른 위에 하나를 배치 2000px 높이 파란색 사각형이 2048 픽셀에서 잘립니다이 경우

<ScrollViewer Background="#4FFF6060"> 
    <Grid Background="#FFFF8A8A" Width="240" HorizontalAlignment="Left" d:LayoutOverrides="Height"> 
     <Rectangle Fill="Blue" Height="4000" VerticalAlignment="Top" Width="120" HorizontalAlignment="Left"/> 
     <Rectangle Fill="Red" Height="2000" VerticalAlignment="Top" Width="120" HorizontalAlignment="Right"/> 
     <Rectangle Fill="Red" Height="2000" VerticalAlignment="Top" Width="120" HorizontalAlignment="Right" Margin="0,2000,0,0"/> 
    </Grid> 
</ScrollViewer> 

하지만 두 사각형이 잘 보인다 .

두 번째 예 4000px 영역을 표시 StackPanel을 사용하고도

<StackPanel Background="#FFFF8A8A" HorizontalAlignment="Right" Width="240" d:LayoutOverrides="Height"> 
    <Rectangle Fill="#FF88FF00" Height="2000" Width="240" HorizontalAlignment="Right"/> 
    <Rectangle Fill="#FF88FF00" Height="2000" VerticalAlignment="Top" Width="240" HorizontalAlignment="Right"/> 
</StackPanel> 
+0

고정 된 최대 크기 값 2048이 있습니까? 사실, 내 프로젝트에서, Rectange 장소는 그리드 패널이며, 일부 어린이 컨트롤이 포함되어 있습니다. –

+0

감사합니다. 충돌 된 격자를 더 많이 분할하려고합니다. –

3

최대 작동한다. WP7의 텍스처 크기는 2048x2048입니다. 사각형의 높이가이 제한을 초과합니다. 일단이 한계 이하로 감소 시키면 작업이 시작됩니다. 당신이 국경 높이를 증가하면, 바닥 부분이 사라집니다

<Grid Grid.Row="1" Height="630"> 
    <ScrollViewer Background="Red" Grid.Row="1"> 
    <Grid> 
     <Border Height="2048" BorderBrush="Blue" BorderThickness="5"> 
     <Rectangle Height="2000" Fill="LightBlue" Width="440"/> 
     </Border> 
    </Grid> 
    </ScrollViewer> 
</Grid> 

: 당신이 아래의 경계를 식별 할 수

이 코드는 실험에 더 적합하다.

다른 한편으로, 나는이 행동이 저를 놀라게한다고 말해야합니다. 그 시스템이 큰 물체를 더 작은 텍스처로 분해 할 것으로 기대하지만 WP7 설계자들은 그렇게하지 않기로 결정했지만 오히려 UI 버그를 드러내기로 결정했습니다.

+0

감사합니다. 추락 된 표를 더 많은 자식 컨트롤로 분할하려고합니다. –