Auto rotation or the views

102 Views Asked by At

i am working with the application and want to stop the rotation when i move the device to landscape mode. Please help me out regarding this. Your help will be much appriciable.

6

There are 6 best solutions below

0
Prine On

Select the project and then go to the General Tab. There you can see the section Deployment Info with the option Device Orientation. Unselect all the orientations you don't need.

XCode Setting

0
mprivat On

If you don't want to support landscape orientation, in Xcode, select your project in the Navigator, then go to Deployment info and uncheck Landscape left and right.

0
Maulik Kundaliya On

In your "Deployment Info" go to "summary" there are "supprted device orientation" , you can set the device orientation.

0
Suhit Patil On

just click on your project and click on General Tab and go to Deployment Info section

and unselect the Landscape Left and Landscape Right option.

enter image description here

enter image description here

enter image description here

0
Ilesh P On

As above is one way to set portrait apps ....

but another way throughout coding like u set particular view portrait...

add this method in your view controller.

- (BOOL)shouldAutorotate;
{
    return YES;
}

- (NSUInteger)supportedInterfaceOrientations;
{
    return UIInterfaceOrientationMaskPortrait ;
}

u can also set the multiple value like ..

- (NSUInteger)supportedInterfaceOrientations;
{
    return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown;
}

it is useful for the different view set different orientation ..

Best of luck..

0
Deepak Bharati On

Go to Project-> TARGET-> General In Deployment Info select iPhone/iPad. Checkmark for desired Device Orientations.