Reputation: 7766
How do I force one view into landscape mode for a graph.
I want to click a tab bar button to make the graph view appear then when a button is clicked on that view I want to push a child screen which I need in portrait mode.
Once they click back i want to return to the graph view in landscape.
Upvotes: 4
Views: 2809
Reputation: 17170
Use UIView's transform property to rotate it by PI radians:
-(void)viewWillAppear:(BOOL)animated
{
CGAffineTransform newTransform = CGAffineTransformMake(0.0,1.0,-1.0,0.0,0.0,0.0);
self.view.transform = newTransform;
}
Upvotes: 5
Reputation: 309
Maybe this will work for you
[[UIApplication sharedApplication] setStatusBarOrientation: UIInterfaceOrientationLandscapeLeft animated:NO];
or
[[UIDevice currentDevice] setOrientation:UIInterfaceOrientationLandscapeLeft];
Upvotes: 0