UITableView create a badge on the right of every cell
I want to create a table view like this one with a badge on the right. Can someone suggest me how can I do to get开发者_开发百科 this result? thanks
I'm using greate open source project TDBadgedCell from Tim Davies for that purposes. It is very simple to use and configure.
Get it here: https://github.com/tmdvs/TDBadgedCell
AFAIK, this is not available by default. You have to customize your cell.
- Create a
UILabel
. - Set
textAlignment
asUITextAlignmentCenter
. - Change its
cornerRadius
. - Add a drop shadow using
shadowColor
,shadowOffset
(a positive offest) ,etc., - Set label's
text
. - Resize label's
width
to fit thetext
. - Set it as cell's
accessoryView
.
精彩评论