6
votes

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 :)

3

3 Answers

1
votes

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;
}
0
votes

Learn how to use autoresizing masks. They are simple but pretty powerful in a majority of cases.

0
votes

NSPostWhenIdle is right. You just have to return yes shouldAutorotateToInterfaceOrientation. That way you can have support for all orientations. Have a look at resizing properties through XIB. that will also make your work easy.