views:

149

answers:

2

I am looking for how to style a label in a UITableView cell, so that it shows how many children/messages are in the next view controller.

This is used in Apple's Mail app, to show how many messages are in the inbox or account.

I am sure that this is a UILabel, but what font, color and how to make the oval around it?

+1  A: 

The font is surely bold Helvetica because that's what Apple uses everywhere in the iPhone UI. To get the exact color, you could take a screenshot and then sample the color with a color picker. For the rounded corners, experiment with a rather large label.layer.cornerRadius.

Ole Begemann
This results in terrible scrolling performance of the table. The only alternative is custom drawing code using drawRect.
Mike
A: 

Instead of using UILabel.layer.cornerRadius, which results in terrible scrolling performance (as mentioned in my comment), subclass UILabel with a custom drawRect.

Here is the version that I use: http://gist.github.com/500793

Mike