UITableView - How to show rows only which contains data

Viewed 11622

How can i show UITableView Rows only which contains data not the other rows. By default UITableView shows 10 rows. If we have data for three rows It will display three rows only How can I implement this? Thank you.

7 Answers

You can set a footer view and make it invisible if you want. Separators will appear only for rows which contain data:

self.theTableView.tableFooterView = [[[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 320.0f, 10.0f)] autorelease];
Related