• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: App is in Landscape Mode, but main UIWindow still thinks it’s portrait.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: App is in Landscape Mode, but main UIWindow still thinks it’s portrait.
      • From: Joshua Garnham <email@hidden>
References: 
 >App is in Landscape Mode, but main UIWindow still thinks it’s portrait. (From: Joshua Garnham <email@hidden>)

  • Prev by Date: Re: Simple question
  • Next by Date: Re: Simple question
  • Previous by thread: App is in Landscape Mode, but main UIWindow still thinks it’s portrait.
  • Next by thread: Re: App is in Landscape Mode, but main UIWindow still thinks it’s portrait.
  • Index(es):
    • Date
    • Thread