开发者

How to create numbers with rounded background in UITableViewCell (like the email app)?

开发者 https://www.devze.com 2023-01-29 19:13 出处:网络
In the email app, on t开发者_运维百科he overview page, you can see a summary of the number of new emails you have in your accounts. Does anyone know how to create the numbers on the rounded background

In the email app, on t开发者_运维百科he overview page, you can see a summary of the number of new emails you have in your accounts. Does anyone know how to create the numbers on the rounded background?

How to create numbers with rounded background in UITableViewCell (like the email app)?


It's not a built-in cell style but should be pretty easy to mimic.

Add a UILabel to the cell set its font, textColor and backgroundColor. To get the rounded corners, play with label.layer.cornerRadius.


If you read this post on TUAW, you can get more infos about your problem...
http://www.tuaw.com/2010/01/07/iphone-devsugar-simple-table-badges/

Tim Grant Davies created an open source project to do what you want and it is available under CC License on github... You can download it here: https://github.com/tmdvs/TDBadgedCell

Hope this can help you :)

0

精彩评论

暂无评论...
验证码 换一张
取 消