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

How to handle back button navigation event in iOS?

$
0
0

Hello,
I am implementing an app using xamarin forms in that I want to implement custom back navigation in iOS.I have implemented for android using below code and its working fine. So is there any way to do same for iOS?

Android:

protected override void OnPostCreate(Bundle savedInstanceState)
    {
        var toolBar = FindViewById<Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
        SetSupportActionBar(toolBar);
        base.OnPostCreate(savedInstanceState);
    }
    public override bool OnOptionsItemSelected(IMenuItem item)
    {
        //if we are not hitting the internal "home" button, just return without any action
        if (item.ItemId != Android.Resource.Id.Home)
            return base.OnOptionsItemSelected(item);
        //this one triggers the hardware back button press handler - so we are back in XF without even mentioning it
        this.OnBackPressed();
        // return true to signal we have handled everything fine
        return true;
    }

iOS:
???????????


Viewing all articles
Browse latest Browse all 77050

Trending Articles



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