Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

GetSupportedInterfaceOrientations is never called in PageRenderer subclass in iOS.

$
0
0

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


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>