开发者

UITableView create a badge on the right of every cell

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 as UITextAlignmentCenter.
  • Change its cornerRadius.
  • Add a drop shadow using shadowColor, shadowOffset(a positive offest) ,etc.,
  • Set label's text.
  • Resize label's width to fit the text.
  • Set it as cell's accessoryView.
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜