Reputation: 33
I have done all the below things, but the screen still auto rotates to portrait.
Correction: To make it clear, I need just one of the screens to go landscape and stay landscape only. The rest of them can orient with the device
public override void ViewDidAppear(bool animated)
{
WillAnimateRotation(UIInterfaceOrientation.LandscapeLeft, 0.0);
base.ViewDidAppear(animated);
}
public override UIInterfaceOrientationMask GetSupportedInterfaceOrientations()
{
return UIInterfaceOrientationMask.Landscape;
}
public override UIInterfaceOrientation PreferredInterfaceOrientationForPresentation()
{
return UIInterfaceOrientation.LandscapeLeft;
}
public override bool ShouldAutorotate()
{
return false;
}
Upvotes: 1
Views: 369
Reputation: 89129
In your either the Project Options dialog, or in the info.plist editor, you can select which device orientations your app supports.
Upvotes: 2