Re: iPad interface orientation basics
Re: iPad interface orientation basics
- Subject: Re: iPad interface orientation basics
- From: David Duncan <email@hidden>
- Date: Thu, 13 May 2010 23:17:30 -0700
On May 12, 2010, at 12:52 PM, sebi <email@hidden> wrote:
> hello,
>
> sorry, this is probably a very simple thing, but i am quite puzzled right now.
>
> when i do this in my view controller:
>
> - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
> CGSize size = self.view.frame.size;
> NSLog(NSStringFromCGSize(size));
> }
>
> the size is always {768, 1024}, regardless of the orientation. why is it not {1024, 768} in landscape mode? The view definitely changes its size, since it always fills the full screen...
Because the frame is in the parent coordinate system, and technically that coordinate system doesn't change when you rotate. If you look at the bounds instead, you will find that they have changed as you expect, because the bounds is in the view's own coordinate system.
--
David Duncan_______________________________________________
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