UIScrollView Dynamic Paging Size
UIScrollView Dynamic Paging Size
- Subject: UIScrollView Dynamic Paging Size
- From: Peng Gu <email@hidden>
- Date: Fri, 04 Oct 2013 13:36:55 +0800
I am implementing a horizontal multi-image scrollview. The images have
variable widths, so a portion of the next imageview image also be shown on
the screen. To display the next image view correctly, I need to change the
paging size.
As this link
<http://stackoverflow.com/questions/1220354/uiscrollview-horizontal-paging-like-mobile-safari-tabs/1220605#1220605>suggests:
I set the scrollview paging enabled, and set clipsToBounds to NO; In the *
scrollViewDidEndDecelerating:* Method, I set the width of the scrollview to
the displaying image's width.
The problem is the contentOffset of the scrollview is not correctly updated
when the scrollview scrolls. For example, the width of the *page0* is 282,
and the contentoffset is (0, 0); but when I scroll to *page1* which has
width 148, the contentoffset is updated to (320, 0); then I scroll to *page2
*which has width 282, but the contentoffset is updated to (444, 0)...
Any ideas? Anyone know how scrollview update its contentoffset ?
Thanks,
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden