High performance rounded corner UITableView
The problem with the previous example was that I was using a second UIScrollView to scroll the UITableView and not the UITableView itself, which is a subclass of UIScrollView and highly optimized for scrolling.
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”.
The link to the sample seems to be broken…
Sorry, my ftp program deleted it after syncing with my website. Will reupload it tomorrow.
Not bad, but still not quite the stocks application. If you notice on the stocks app, the scroll indicator is still there. If you turn yours on it gets clipped (probably why you turned it off) but theirs doesn’t. The same goes with framing the table with a picture and transparent center it will mask off the scroll indicator.
I’m wondering if they actually use a TableView as a TableViewCell. And set up a parent table that has two sections one cell each. The top section has the list of stocks. That section has one cell which is itself a TableView… idk. It’s still not exactly the same behavior….frustrating.
Great work though, creative.
[...] think your table views are just too square for the iPhone’s nice rounded aesthetic, try using RoundedTableView. A very elegant and efficient way to create tables as subviews with smooth rounded corners. It [...]