Install only one ViewController in landscape mode

I am new to ios.

I want to show only one viewController in landscape mode, the other is everything in portrait.

So, please help me and tell me how I can change only one view in landscape mode in the application.

I already searched for it, but did not find a specific answer.

+4
source share
3 answers

if you use a navigation controller and a controller that presses this “landscape-oriented” view controller only in portrait mode, you will have to manually rotate the uiview using CGAffineTransformation.

 - (void)viewDidLoad { [super viewDidLoad]; // If you require full screen then hide the navigation bar with following commented line. //[self.navigationController setNavigationBarHidden:YES animated:NO]; // Rotates the view. CGAffineTransform transform = CGAffineTransformMakeRotation(-M_PI/2); self.view.transform = transform; // Repositions and resizes the view. // If you need NavigationBar on top then set height appropriately CGRect contentRect = CGRectMake(0, 0, 480, 320); self.view.bounds = contentRect; } 
+4
source

For iOS6 add this method to your ViewController

 -(NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskLandscape; } 
+2
source

Are you using a UINavigationController?

 - (NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskLandscape; } -(BOOL) shouldAutorotate { return YES; } 
0
source

All Articles