Reputation: 5264
As you can see here, I have only 2 data for testing and they are loaded into the table view . This is good. But, there are many empty cells have also been automatically generated.
How to make these empty cells invisible?
Upvotes: 1
Views: 226
Reputation: 11
You can reduce the overall height of the tableview when your view is loaded. Calculate the height of the the table view based on total cell height. Assign the table height max to screen height.
Upvotes: 1
Reputation: 9144
This should work :
self.tableView.separatorColor = [UIColor clearColor];
self.tableView.backgroundColor = [UIColor clearColor];
Upvotes: 2
Reputation: 82759
yourtableViewname.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
or
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
return 0.01f;
}
and for iOS 7
self.yourtableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
Upvotes: 3