Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Converting View from Landscape to Portrait?

I have already developed the app for Landscape mode,now the client is asking to build in both Landscape and Portrait mode.

How can i convert landscape View to portrait View?

Now i am using this code for Landscape View:

 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{

 return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft) || (interfaceOrientation == UIInterfaceOrientationLandscapeRight);

 }

Please help me....

Advance Thanks :)

like image 610
Nithinbemitk Avatar asked Sep 05 '12 13:09

Nithinbemitk


1 Answers

Simple, to support all orientations just return YES to shouldAutorotateToInterfaceOrientation.

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{
    return YES;
    //Or to support all but portrait upside down
    return interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown;
}
like image 80
Mick MacCallum Avatar answered Sep 30 '22 16:09

Mick MacCallum