开发者

how to get max offset of scrollview in wp7?

I manged to get and set scrollerOffest as :

double horizonatalOffest 开发者_StackOverflow= sv.HorizontalOffset; 
Debug.WriteLine("horizonlat offset: " + horizonatalOffest.ToString()); 
sv.ScrollToHorizontalOffset(2000);

The problem is how to get the max offset. Say I have the scroller 0 to 50000. So how can I get max offset? Scrollview.HorizontalOffset returns current offset position? Note that My scroller grows/shrinks during run time.


The maximum offset for the ScrollViewer will depend on its content. Obtain the child of the ScrollViewer, and obtain its height via its ActualHeight property. You then subtract the ScrollViewer ActualHeight property value to give you the maximum offset.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜