I don't know how to do Portrait and Upside down in iOS 6
Asked Answered
T

3

5

I am using:

- (NSUInteger)supportedInterfaceOrientations {

    return UIInterfaceOrientationMaskPortrait; 

}

How would I use this for Portrait and Upside down in iOS6?

this works for landscape left UIInterfaceOrientationMaskLandscapeLeft

and this for Landscape right UIInterfaceOrientationMaskLandscapeRight

and this for both landscapes UIInterfaceOrientationMaskLandscape

Tightwad answered 16/12, 2012 at 12:38 Comment(0)
A
6

You need to return a valid bitmask of the orientations you wish to support:

For portrait and portrait upside down:

- (NSUInteger)supportedInterfaceOrientations {

    return (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown);

}

You can see a list of the supported orientation masks

It's important to note also, that you need to list portrait upside down in your supported orientations as well:

enter image description here

Astragalus answered 16/12, 2012 at 12:51 Comment(1)
I had already done that in Project settings and thanks for the code.Tightwad
S
1

You need to use the bitwise OR operator for each supported orientation.

- (NSUInteger)supportedInterfaceOrientations {
    return UIInterfaceOrientationMaskPortrait |
        UIInterfaceOrientationMaskPortraitUpsideDown; 
}

Add another bitwise OR for each orientation you want to support. Typically, when you see a constant with the word "mask" in it, they are meant to be combined in this way.

Supergalaxy answered 16/12, 2012 at 12:46 Comment(0)
M
1

I had me too the same problem here

Your should solve your problem too.

  • allow the rotations
  • at top components need to allow again

Watch carefully those methods, seems similar, but aren't

Monjo answered 16/12, 2012 at 12:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.