tags:

views:

36

answers:

2

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.

A: 

Maybe this will work for you

[[UIApplication sharedApplication] setStatusBarOrientation: UIInterfaceOrientationLandscapeLeft animated:NO];

or

[[UIDevice currentDevice] setOrientation:UIInterfaceOrientationLandscapeLeft];
Bart Schoon
+1  A: 

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;

}

http://developer.apple.com/library/ios/#documentation/uikit/reference/UIView_Class/UIView/UIView.html%23//apple_ref/doc/uid/TP40006816-CH3-SW4

Roger Nolan