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; }
source share