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

Why is UIBarButtonSystemItem.Action not displaying?

$
0
0

I have a PageRenderer to Add Action icon to the top right, which does social sharing function. Here is the code:

public override void ViewDidLoad()
{
    base.ViewDidLoad();
    NavigationItem.RightBarButtonItem = new UIBarButtonItem (UIBarButtonSystemItem.Action, ShareProduct); // Action icon not displaying
}

private void ShareProduct(object sender, EventArgs e) {
        var shareItems = new List<NSObject> ();
        shareItems.Add (new NSString("Share blahblah"));

        var activityController = new UIActivityViewController (shareItems.ToArray (), null);
        PresentViewController (activityController, true, null);
}

I know I can use ToolbarItems.Add(new ToolbarItem("name", "icon path", Action)); on X.F side just like Todo List sample, but I wanna use UIBarButtonSystemItem.Action so that I can use iOS native Social Sharing.

Thank you.


Viewing all articles
Browse latest Browse all 58056

Trending Articles



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