How to show badges count of toolbarItem icon in xamarin.forms

OmarMohOmarMoh USMember ✭✭

Hi developers

I need to show badge count of toolbarItem like cart icon,

i found a solution but it doesn't work with TabbedPage correctly.

When i switch other tab the badge counter is disappears so after using
this.CurrentPageChanged += (sender, e) =>{ //set badge counter DependencyService.Get<IToolbarItemBadgeService>().SetBadge(this,ToolbarItems.First(), "1", Color.Yellow, Color.Black); };
after implementing this code on IOS the app crashed in BarButtonItemExtensions.cs class.

if there someone have other solution or can fix this please help me and thanks for all

Answers

Sign In or Register to comment.