Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
iOS Development
Autorotation & Positioning Problem
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Mark FX" data-source="post: 1456001" data-attributes="member: 211556"><p>Firstly you should not use the shouldAutorotateToInterfaceOrientation: Method to reposition views or subviews, only use the shouldAutorotateToInterfaceOrientation: Method to return the desired or supported device orientations only, like this.</p><p></p><p>[CODE]</p><p>- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation</p><p>{</p><p> // Return YES for supported orientations</p><p> return (UIInterfaceOrientationIsPortrait(interfaceOrientation) || UIInterfaceOrientationIsLandscape(interfaceOrientation));</p><p>}</p><p>[/CODE]</p><p></p><p>The above example allows for all device orientations, including portrait upside down.</p><p></p><p>Secondly you should use the viewControllers viewDidLoad: viewWillAppear: or viewDidAppear Methods to check the devices orientation, and do any repositioning code.</p><p></p><p>Hope this helps.</p><p></p><p>Regards mark</p></blockquote><p></p>
[QUOTE="Mark FX, post: 1456001, member: 211556"] Firstly you should not use the shouldAutorotateToInterfaceOrientation: Method to reposition views or subviews, only use the shouldAutorotateToInterfaceOrientation: Method to return the desired or supported device orientations only, like this. [CODE] - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations return (UIInterfaceOrientationIsPortrait(interfaceOrientation) || UIInterfaceOrientationIsLandscape(interfaceOrientation)); } [/CODE] The above example allows for all device orientations, including portrait upside down. Secondly you should use the viewControllers viewDidLoad: viewWillAppear: or viewDidAppear Methods to check the devices orientation, and do any repositioning code. Hope this helps. Regards mark [/QUOTE]
Verification
Post reply
Forums
macOS & iOS Developer Playground
iOS Development
Autorotation & Positioning Problem
Top