GetSupportedInterfaceOrientations is never called in PageRenderer subclass in
iOS. Does anyone know a workaround for this?
Here is the code:
[assembly: ExportRendererAttribute(typeof(MainPage), typeof(MainPageRenderer))]
namespace MyApp.iOS
{
public class MainPageRenderer : PageRenderer
{
public override bool ShouldAutorotate()
{
return true;
}
public MainPageRenderer()
{
}
[Export("application:supportedInterfaceOrientationsForWindow:")]
public UIInterfaceOrientationMask
GetSupportedInterfaceOrientations(UIApplication application, IntPtr forWindow)
{
// Never called!!!
return UIInterfaceOrientationMask.LandscapeLeft;
}
}
}
Filed a bug report: https://bugzilla.xamarin.com/show_bug.cgi?id=28787
There is an old thread on this, where the questions regarding this issue in Xamarin.Forms remained unanswered: https://forums.xamarin.com/discussion/19177/preventing-rotation-on-ios-on-a-specific-page#latest