Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xamarin Forms ToolBarItem (Number over the Icon) Notification

I wish to display notifications as shown in the image link below using Xamarin Forms shared project. Is there a way to add text/number over the icon of the toolbar item?

Follow this link to view example since i cant post images.

like image 845
ajinkyapuar Avatar asked Sep 29 '22 12:09

ajinkyapuar


1 Answers

This is not possible out of the box in Xamarin Forms at the moment (v1.4). You can however create a custom renderer in your iOS and Android project that does the trick.

This article might help you: Creating a Cross-Platform Application Bar for Xamarin

On TabBarItem (for iOS) there is a possibility to set BadgeValue which probably is what you are looking for. This property does not exist on ToolBarItem.

Another, uglier, solution is to add images with different numbers and in your view model select the appropriate image.

like image 183
Fredrik Avatar answered Oct 05 '22 06:10

Fredrik