Re: App is in Landscape Mode, but main UIWindow still thinks it’s portrait.
Re: App is in Landscape Mode, but main UIWindow still thinks it’s portrait.
- Subject: Re: App is in Landscape Mode, but main UIWindow still thinks it’s portrait.
- From: David Duncan <email@hidden>
- Date: Thu, 22 Apr 2010 09:12:08 -0700
On Apr 22, 2010, at 8:35 AM, Joshua Garnham wrote:
> My App runs in landscape mode and I have been converting a CGPoint
> to the main UIWindow's co-ordinate system.
Why? There should generally be no need to convert to the window's coordinate system.
> UIWindow's co-ordinate system the co-ordinates changed as if the iPhone was in portrait mode.
Thats because the window itself doesn't actually change coordinate systems, it applies a transform to its subviews that changes their coordinate system.
> Code and Debugger results are as follows.
> - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
> [[UIApplication sharedApplication] setStatusBarOrientation: UIInterfaceOrientationLandscapeLeft];
> return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
> }
Also note that you should not be changing the status bar orientation here. It is sufficient to simply return YES for the orientations that you want (assuming that you've done everything else correctly).
--
David Duncan
Apple DTS Animation and Printing
_______________________________________________
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