iphone - Clean autorotation transitions in a paging UIScrollView -
i have paging uiscrollview in user pages horizontally through images, apple's photos.app. works, i'm trying add rotation support.
i've got view rotating ok , have managed set contentsize, bounds, , subviews' frames adapt different orientations. before , after rotation, ok.
however, transitions awkward. first image rotates perfectly, if axis of rotation in dead center of image (scrollview frame). second image "swings" in because axis of rotation in same place: center of first image. farther away first image, faster "swing."
i can mask overlaying opaque uiview before rotation , hiding after. that's hack. there must elegant way this...
frankly, don't know you're doing, since haven't shown @ all.
but!
i created sample project few views in scroll view, , works fine. feel free pick apart wish. works creating 5 views, , adding them scroll view. after these views set first time, , every time application rotates, calls method alignsubviews
lay them out @ right page locations , make them same size scroll view, while updating scroll view's contentsize
. before rotation occurs, keeps track of page scroll view on, , resets page during rotation (because page size has change).
Comments
Post a Comment