简体   繁体   中英

How to add badge on a button in a cell?

Achieve this without third party, How to add a badge on a button in a cell? Badgevalue change when receive a new message, and reset when pressed,

badgeValue is a property of UIBarButtonItem , so you can simply set it with the following:

yourUIBarButtonItem.badgeValue = @"YourBadgeValue";

You can add this code to any method that is called when "reset" is pressed or anytime you want to change the value.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM