Need to prevent screen rotation on specific view controller
I've tried below-
public override bool ShouldAutorotateToInterfaceOrientation(UIInterfaceOrientation toInterfaceOrientation)
{
return false;
}
public override bool ShouldAutorotate()
{
return false;
}
public override UIInterfaceOrientation PreferredInterfaceOrientationForPresentation()
{
return UIInterfaceOrientation.Portrait;
}
public override UIInterfaceOrientationMask GetSupportedInterfaceOrientations()
{
return UIInterfaceOrientationMask.Portrait;
}
Nothing worked.
Thanks in Advance!
You can solve this problem with this explanation.
1) In you AppDelegate add a boolean for example
2) Modify your UIInterfaceOrientationnMask in the AppDelegate
3) Call in the controller of the view that you want change orientation
4) and when the view is close or change you need to put again the boolean in false and put your screen in the original orientation only if you want.
I hope this solve your problem I have the same problem days ago and this help me.