• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Best practice for adjusting UIScrollView contentOffset in 'willTransitionToTraitCollection'
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: The joys of people using valueForKey to get objects out of a dictionary.
  • Next by Date: Re: The joys of people using valueForKey to get objects out of a dictionary.
  • Previous by thread: Re: 10.11: NSDatePicker cuts off year digit
  • Next by thread: Storing files into the Documents folder
  • Index(es):
    • Date
    • Thread