Anyone know a workaround for the PreferredScreenEdgesDeferringSystemGestures bug?

There is a bug preventing a Forms app from setting the PreferredScreenEdgedDeferringSystemGestures in Xamarin.Forms in iOS.
from here: github.com/xamarin/Xamarin.Forms/issues/2241

Does anyone have a workaround for this until the bug is fixed. Its been over a year since it was found and is still open.

Here is my code:

[assembly: ExportRenderer(typeof(MyApp.Views.MainPage), typeof(MyApp.iOS.Renderers.MainPageRenderer))]
namespace MyApp.iOS.Renderers
{
    public class MainPageRenderer : PageRenderer
    {
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            if (UIDevice.CurrentDevice.CheckSystemVersion(11, 0))
            {
                SetNeedsUpdateOfScreenEdgesDeferringSystemGestures();
            }
        }
        public override void SetNeedsUpdateOfScreenEdgesDeferringSystemGestures()
        {
            base.SetNeedsUpdateOfScreenEdgesDeferringSystemGestures(); 
        }
        public override UIRectEdge PreferredScreenEdgesDeferringSystemGestures
        {
            get
            {
                return UIRectEdge.Top | UIRectEdge.Bottom; // This never gets called
            }
        }
    }
}
Sign In or Register to comment.