Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Locking Portrait Orientation in View? iOS 7

So, I want to lock the orientation of my home page to portrait, and the Home page ONLY.

I am using a tab bar controller, so the initial view is the tab controller, but the view controller that appears first is the first tab, e.g. the Home page.

I would like to make it so that when the user goes to rotate the device, it WILL NOT rotate to landscape on this page. However all other pages can rotate.

I have searched around, and nothing seems to be specific to iOS 7, and the one that is specific to iOS 7 doesn't work…

Please help, thank you!

The image below describes what I DON"T want to happen, for this page.

enter image description here

like image 573
n00bAppDev Avatar asked Nov 07 '13 03:11

n00bAppDev


1 Answers

Implement the following in your implementation

- (NSUInteger) supportedInterfaceOrientations {

    return UIInterfaceOrientationMaskPortrait;

}

This should give you the results you are looking for!

like image 60
vzm Avatar answered Sep 20 '22 20:09

vzm