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

README.md

id title brief sdk
79698AE6-8B70-7189-D52D-2D1801EEB833
Add a Nav Bar Right Button
This recipe shows how to add a right button to a navigation bar.

Recipe

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

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

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

this.NavigationItem.SetRightBarButtonItem(
    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);