xamarin.ios - Hide iOS navigation bar in Xamarin but retain ability to swipe back -


i'm trying hide navigation bar on ios xamarin want keep ability swipe last page.

i've tried doing this:

        this.viewcontroller.navigationcontroller.navigationbar.hidden = true; 

and this:

        this.viewcontroller.navigationcontroller.navigationbarhidden = true; 

in custom pagerenderer neither of hide navigation bar. if remove navigation bar when i'm pushing page, lose ability swipe back.

any suggestions?

try this:

public class pagecustomrenderer : pagerenderer, iuigesturerecognizerdelegate {     public override void viewwillappear(bool animated)     {         base.viewwillappear(animated);          if (navigationcontroller != null)         {             navigationcontroller.navigationbarhidden = true;             navigationcontroller.interactivepopgesturerecognizer.delegate  = this;             navigationcontroller.interactivepopgesturerecognizer.enabled = true;         }     } } 

this in pagerender in ios viewcontroller can access navigationcontroller there.

you need make pagerenderer implement iuigesturerecognizerdelegate can make delegate interactivepopgesturerecognizer of navigationcontroller

hope helps.-


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -