Search code examples
iosautorotatescreen-rotation

Upside down - iOS Xcode not working while using autolayout


using autolayout feature in xcode 6.3.2 , i am able to adjust my views, buttons and text fields for iPad and iPhone. but for upside down my view doesnt chagne, Any idea How do we support upside down mode using auto layout without adding any code to your view controllers. I have also checked the upside down mode in project settings in xcode.

sample code :- https://github.com/deepesh259nitk/OrientationSupport

screen shots below.

enter image description here

enter image description here

max.


Solution

  • You also need to override -supportedInterfaceOrientations inside each view controller you want to support upside down orientation, since by default that method returns UIInterfaceOrientationMaskAllButUpsideDown on iPhone.

    - (UIInterfaceOrientationMask)supportedInterfaceOrientations
    {
        return UIInterfaceOrientationMaskAll;
    }