Best practice for adjusting UIScrollView contentOffset in 'willTransitionToTraitCollection'
Best practice for adjusting UIScrollView contentOffset in 'willTransitionToTraitCollection'
- Subject: Best practice for adjusting UIScrollView contentOffset in 'willTransitionToTraitCollection'
- From: David Hoerl <email@hidden>
- Date: Tue, 10 Nov 2015 14:08:12 -0500
- X_v_e_cd: 98b10f444a00c8e16a5d6d1b64fc5a27
- X_v_r_cd: b6f8eb4de8480cc9a233db15f54d9333
I have a UIScrollView scrolled to the bottom of content - so the content
bottom is at the bottom of the view - in a compact environment.
When the view rotates to regular, the contentOffset is too large - so
the bottom of the content appears in the middle of the view.
Without hard coding nav bar and tab bar sizes for regular and compact, I
don't see how I can compute the contentOffset.y max value prior to the
rotation - I poked around the protocols of the
UIViewControllerTransitionCoordinator coordinator passed in with the
'willTransitionToTraitCollection' message to no avail.
A similar protocol, UIViewControllerContextTransitioning, offers the
initial and final frames, but I cannot see how to get those from
anything available in willTransitionToTraitCollection.
Suggestions?
- David
_______________________________________________
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