Sahil
Sahil

Reputation: 5

Auto rotation or the views

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.

Upvotes: 0

Views: 58

Answers (6)

Deepak Bharati
Deepak Bharati

Reputation: 280

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

Upvotes: 0

Ilesh P
Ilesh P

Reputation: 4046

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..

Upvotes: 0

Prine
Prine

Reputation: 12538

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

Upvotes: 0

Suhit Patil
Suhit Patil

Reputation: 12023

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

Upvotes: 1

Maulik Kundaliya
Maulik Kundaliya

Reputation: 462

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

Upvotes: 0

mprivat
mprivat

Reputation: 21912

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.

Upvotes: 0

Related Questions