Background
Recently I got one case from customer to resolve the below issue:
If we set NavigationBar to hidden status in Xamarin.Forms, then iOS gesture for return will also be disabled.
Code as below:
1 | NavigationPage.SetHasNavigationBar(this, false); |
Solution
In native iOS application, we can call the below function to make sure the Swipe gesture always be available to use:
1 | [self.navigationController.interactivePopGestureRecognizer setDelegate:nil]; |
This is obviously a platform-specific code, so it’s also quite straightforward to think about the solution in Xamarin.Forms.
We will rewrite the PageRenderer
to achieve:
1 | public class BaseCoreRenderer: PageRenderer |
After testing, this can resolve the issue as expected.
Comments