Re: UIView final frame after device rotation
Re: UIView final frame after device rotation
- Subject: Re: UIView final frame after device rotation
- From: Markus Spoettl <email@hidden>
- Date: Tue, 02 Apr 2013 23:14:28 +0200
On 4/2/13 10:39 PM, David Duncan wrote:
On Apr 2, 2013, at 1:25 PM, Markus Spoettl <email@hidden> wrote:
On 4/2/13 8:37 PM, David Duncan wrote:
I have a hard time figuring out how to get the frame (in the window
coordinate system) a view will rotate to, when the rotation has just
begun.
What are you trying to do?
Typically you don't need to worry about this. The root view controller's
view will have its frame set properly by UIKit, and then all of your
other views will resize with respect to that view's bounds, and as such
you don't need to know how to get the final frame of that view.
I'm displaying an overlay window which is "attached" to the view in
question.
I would think there might be an easier way to do this rather than using an
overlay window, but I'm not entirely certain what your end goal is or what
you are trying to overlay. You might consider an approach that uses view
controller containment however.
Actually I did experiment with using embedded views instead of an overlay window
but it was a lot easier to make "it" work that way. The overlay window lets us
completely separate the overlay from the view's hierarchy.
It would be an architectural problem to move that "into" the view hierarchy.
When the rotation takes place, it needs to realign itself so that it's new
location agrees with what the view displays (in my context).
Have you tried doing this inside of -viewDidLayoutSubviews for the view
controller that is managing all of this? That should be the best place to get
the location of views after the layout has completed, although the animation
information would need to be obtained seperately. -- David Duncan
No, I haven't tried that, not sure if you mean this would apply to an overlay
solution. I'll see if I can figure out a way to use that.
Still, there must be a way to get to the target view's frame before the
animation is complete, no? When device rotation is complete, the view frame is
correct. It's only ever "wrong" when the rotation notification is delivered.
Regards
Markus
--
__________________________________________
Markus Spoettl
_______________________________________________
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