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: Joshua Garnham <email@hidden>
- Date: Thu, 22 Apr 2010 16:50:48 +0000 (GMT)
The reason I have been doing it is because of a problem I have been having with moving a View. Maybe you could help me with that?
The View is supposed to move as my touch moves but the view seems to flicker between to places, as you can see here.
And this is the code I have been using.
--
Joshua Garnham
________________________________
From: David Duncan <email@hidden>
To: Joshua Garnham <email@hidden>
Cc: email@hidden
Sent: Thu, 22 April, 2010 17:12:08
Subject: Re: App is in Landscape Mode, but main UIWindow still thinks it’s portrait.
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