开发者

how to get max offset of scrollview in wp7?

开发者 https://www.devze.com 2023-03-25 01:02 出处:网络
I manged to get and set scrollerOffest as : double horizonatalOffest 开发者_StackOverflow= sv.HorizontalOffset;

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

精彩评论

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

关注公众号