• 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: iPhone/iPad device orientation problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: iPhone/iPad device orientation problems


  • Subject: Re: iPhone/iPad device orientation problems
  • From: M Pulis <email@hidden>
  • Date: Wed, 13 Oct 2010 21:53:12 -0700

Sir,

Not sure I understand the problem... the user determines the orientation of the device... all (I think) we can/should do is respond to whatever orientation is when we launch and when notified of changes...

To "force" the device, have you looked at - (BOOL)shouldAutoRotateToInterfaceOrientation...... ? For example, this can be used to "force" a landscape layout when the device is held in or moved into portrait orientation.

I use the free built-in Xcode documentation and examples, don't know about the Wrox book, but it does not look like it is adding anything worthwhile to the knowledge base.

Gary

On Oct 13, 2010, at 7:16 PM, William Squires wrote:

Hi
What's the proper way to force an iOS device to set the orientation to one of


UIInterfaceOrientationLandscapeLeft
UIInterfaceOrientationLandscapeRight
UIInterfaceOrientationPortrait
UIInterfaceOrientationPortraitUpsideDown

?

The (relatively new) Wrox book says to do something along the lines of

[[UIDevice currentDevice] setOrientation:<one of the orientation constants above>];

but both the documentation and the compiler say no. The documentation states that 'orientation' is a readonly property of the UIDevice class, and the compiler confirms this with a warning that "UIDevice may not respond to 'setOrientation:'"

I know you can set the initial orientation in the viewDidLoad method, but that technique doesn't quite work anywhere else - it'll set the orientation all right, but the view itself won't act as if that's the orientation in use... at least on the iPad simulator; haven't tried uploading it to my iPad yet.

So what is the correct way of programmatically setting the interface orientation in iOS devices?

_______________________________________________

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

_______________________________________________

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


References: 
 >iPhone/iPad device orientation problems (From: William Squires <email@hidden>)

  • Prev by Date: Text Tables created programatically don't play nice with standard table UI
  • Next by Date: Re: iPhone/iPad device orientation problems
  • Previous by thread: iPhone/iPad device orientation problems
  • Next by thread: Re: iPhone/iPad device orientation problems
  • Index(es):
    • Date
    • Thread