I created a custom navigationbar. Works fine, only on iOS swipe back does not work. I'm trying to fix this with a custom render based on this thread: http://stackoverflow.com/questions/24710258/no-swipe-back-when-hiding-navigation-bar-in-uinavigationcontroller
This is my custom render:
[assembly: ExportRendererAttribute(typeof(BasePage), typeof(BasePageRenderer))]
namespace myapp
{
public class BasePageRenderer: PageRenderer, IUIGestureRecognizerDelegate
{
[Export("gestureRecognizerShouldBegin:")]
public bool ShouldBegin(UIGestureRecognizer recognizer)
{
if (recognizer is UIScreenEdgePanGestureRecognizer && NavigationController.ViewControllers.Length == 1)
{
return false;
}
return true;
}
public override void ViewDidLoad()
{
base.ViewDidLoad();
NavigationController.InteractivePopGestureRecognizer.Delegate = this;
}
}
}
Somehow it crashes on this line: NavigationController.InteractivePopGestureRecognizer.Delegate = this;
Did someone implement this and got it working? Thanks.