I am trying to set dynamic height of table. But it is not working when I log height of table it is showing me dynamic height but not set to actual table.
Here is my code
To set the height for row you need to set
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return rowHt[indexPath.row];
}
The each row can have different height only if you set it at
heightForRowAtIndexPath
for that you need to select the corresponding rows from
indexPath.row
If you are setting your tabelView from code it would look something like this
@property(nonatomic, strong) UITableView *table_sender;
self.table_sender = [[UITableView alloc] initWithFrame:frameTable style:UITableViewStylePlain] ;
self.table_sender.dataSource = self;
self.table_sender.delegate = self;
where rowHt is a array of collection of height for each rows