Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information. reorganizing files into recipes folder Mar 7, 2018

id title brief sdk
Add a Nav Bar Right Button
This recipe shows how to add a right button to a navigation bar.


To add a button to the UINavigationBar using a built-in icon from the UIBarButtonSystemItem enumeration:

    new UIBarButtonItem(UIBarButtonSystemItem.Action, (sender,args) => {
       // button was clicked
, true);

To add a button to the UINavigationBar using a custom image:

    new UIBarButtonItem(UIImage.FromFile("some_image.png")
    , UIBarButtonItemStyle.Plain
    , (sender,args) => {
       // button was clicked
, true);

Additional Information

To remove the button:

this.NavigationItem.SetRightBarButtonItem(null, true);