Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I'm no expert on the topic, but here are my thoughts:</p> <p>If you want to also have the app respond to device rotations, the proposal is a bit more complicated. However, if you want to eliminate physical device rotation reactions in favor of rotating the app yourself, there are only a few steps necessary:</p> <ol> <li><p>Stop the views from auto-rotating. In <strong>iOS 6</strong>, this is as simple as implementing the <code>shouldAutorotate:</code> method and returning <code>NO</code> and the <code>supportedInterfaceOrientations</code> method to only return the one orientation you want to allow in the view controller at the <strong>root</strong> of your controller hierarchy. In <strong>iOS 5</strong> and earlier, you want to implement the <code>shouldAutorotateToInterfaceOrientation:</code> to only return <code>YES</code> for one orientation in the view controller that is at the <strong>top</strong> of the view controller hierarchy.</p></li> <li><p>Add code that reacts to the gesture you want to use to rotate the screen (maybe a gesture recognizer).</p></li> <li><p>When the gesture is performed by the user, rotate whichever view is at the bottom of the view hierarchy in your app. Likely, you will rotate the view managed by the <code>rootViewController</code>. Remember that you will need to deal with the new size of this view, not just the orientation. To affect the rotation, I think the best route is to apply an affine transform to the view's layer. <a href="http://www.informit.com/articles/article.aspx?p=1951182" rel="nofollow">This</a> is pretty helpful if you are not familiar with affine transforms.</p></li> </ol>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload