Add a Badge to a Tab Item
- PDF for offline use
- Related Articles:
- Related SDKs:
Let us know how you feel about this
This recipe shows how to display a badge on a tab.
A badge is a small red oval with white border than is displayed over the top-right corner of a tab. It is usually used to indicate the number of new items that will be displayed when the tab is selected (such as the Updates tab in the App Store).
A badge will appear on a tab if the BadgeValue property is set:
tab.TabBarItem.BadgeValue = "3";
To remove a badge that has been previously displayed, set the property to null:
tab.TabBarItem.BadgeValue = null;
You cannot use an empty string to clear the badge – that will result in the red and white circle appearing without any content.