Reproducing an UITableView like in Stocks/Spotlight/Weather (< iOS 7)

by Hans Pinckaers

Here is a solution. The advantage of this one is that it is fast, but it’s not that easy and straightforward.
There are three view related properties for the uitableviewcell:

@property(nonatomic, readonly, retain) UIView *contentView

@property(nonatomic, retain) UIView *backgroundView

@property(nonatomic, retain) UIView *selectedBackgroundView

The backgroundView of the first and last UITableCell will be changed so that they have rounded corners at the proper place.

The selectedBackgroundview will be changed so that the blue selection of the first and last table cell will be corrected with the rounded corners of the backgroundView.

The gradient is drawn with Core Graphics. So you also learn with this project how to draw a gradient.

The only negative point of this technique is that I needed to make the separatorColor “clearColor”.

Download the project

Here