21 July, 2011

WP7: My scrollviewer doesn’t work!

If you ever find yourself wondering why your ScrollViewer does not kick in (as I was wondering!); you have most likely forgotten what I did.

You need to set the height and width of the scrollviewer explicitly to make it work.

   </controls:PivotItem>

<
controls:PivotItem Header="legal">
<
ScrollViewer Width="460" Height="700">
<
StackPanel x:Name="stkPnl"/>
</
ScrollViewer>
</
controls:PivotItem>
</
controls:Pivot>

The size of this control (ScrollViewer) is simply a “window” to your data that allows you to scroll the content of this window. Due to this reason – you need to tell WP7 that it should only display a fixed window of data to the User.


StackOverflow Tags:

1 comment:

Depechie said...

Did you see this? Maybe it could help with your scrollviewer problem...

http://www.danielmoth.com/Blog/ScrollViewerEnsureVisible-For-Windows-Phone.aspx