Converting View from Landscape to Portrait?
Asked Answered
P

3

6

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

Procurance answered 5/9, 2012 at 13:5 Comment(0)
W
1

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;
}
Wyck answered 5/9, 2012 at 13:55 Comment(0)
W
0

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

Wilderness answered 5/9, 2012 at 13:6 Comment(0)
S
0

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.

Salesin answered 21/9, 2012 at 11:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.