Reputation: 3301
UItableView is showing with empty rows like below...
how to hide it without changing the tableview style. Do I need to resize the table View, if so how can I know the height exactly to set.
Upvotes: 4
Views: 2054
Reputation: 408
Just drag and drop a view from object library to the TableView empty shell in storyboard. Make the view as footer of the table view (in document outline drag it below the cell's if it is not already at below) make the height of the view '0'. You will not see the view in storyboard because its height is '0' but when its runs it will hide the cells. I think that should work.
Upvotes: 0
Reputation: 1818
What I had done in one of my projects was to set the tableview's background color to clearColor and separator to none.
Upvotes: 0
Reputation: 3015
you add UIview in footer of uitabeview use of xib or tableview delegate method
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section;
{
return 1;
}
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section;
{
return yourview;
}
Upvotes: 3
Reputation: 2295
Why don't you put some logic into your
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
function?
Just return the number of cells which are really filled with data
Upvotes: -1