Re: UIView final frame after device rotation
Re: UIView final frame after device rotation
- Subject: Re: UIView final frame after device rotation
- From: Quincey Morris <email@hidden>
- Date: Tue, 02 Apr 2013 15:47:25 -0700
On Apr 2, 2013, at 14:21 , Markus Spoettl <email@hidden> wrote:
> Not sure if I understand what you're saying, but if that was the case, the view's frame I'm attaching the overlay to would turn out wrong if the device is rotated.
No, once the rotation is complete (at least), there'd be no transform any more, and so the frame would then be valid.
I looked at what happens when I rotate iBooks from portrait to landscape on an iPad (a +90 degree rotation), and this is what I see:
1. The view changes from portrait layout to landscape layout, but is displayed so the text is still in portrait orientation. In other words, the view behaves *as if* it immediately resizes to its final landscape orientation bounds, and is immediately displayed with a -90 degree rotation relative to landscape orientation, which "preserves" the original text orientation.
2. The view animates the rotation to landscape. That is, the view appears to animate its rotation smoothly from -90 degrees up to 0 degrees, relative to landscape orientation. (There may also be a scaling involved here, I couldn't quite tell since it all happens so fast. If there is one, it also ends at 100%.)
3. At that time, the transformation is the identity transformation.
If the rotation notification is sent after step 1, the view frame is meaningless until step 3.
> The only time I get a bogus view frame is when the rotation notification is delivered.
It would be easy to try examining the "bounds" and "center" properties at the time of the notification, and see whether *they* are bogus. If not, you should be able to orient your child view using those two properties, instead of using "frame".
_______________________________________________
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