paul_1991
paul_1991

Reputation: 231

UITableView create a badge on the right of every cell

Example

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

Upvotes: 0

Views: 3402

Answers (2)

Nekto
Nekto

Reputation: 17877

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

Upvotes: 5

EmptyStack
EmptyStack

Reputation: 51374

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.

Upvotes: 3

Related Questions