WP7 ScrollViewer error when content height> 2000 pixels

In my project, I use ScrollViewer to show some long height information.

I use like this:

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

But, unfortunately, the rectangle is not displayed completely when scrollView vertical height> 2000.

I tested without a Grid as the contents of a ScrollViewer, only with a Rectangle, the result is the same.

And the error also happens with Width.

Do you have any ideas what a workaround is? how to deal with it?

This post is the same problem without any fixes.

Thanks, advanced! -Jimmy


Full xaml test:

<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
source share
2 answers

, : . < 2048.

UPD:

2048px - . (< 2048) scrollviewer ( > 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>

2048 , 2000 , , .

StackPanel 4000

<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>
+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.

+3

All Articles