I have a tableView with two custom cells. I need to to define the height of one cell but leave the other alone. I am trying to learn Objective-C, so any help would be greatly ap
To specify the height of a table cell, you need to provide the UITableViewDelegate
method tableView:heightForRowAtIndexPath:.
I am trying to learn Objective-C, so any help would be greatly appreciated!
Your first port of call should be the documentation.
In your UITableView delegate, implement the routine tableView:heightForRowAtIndexPath: and return whatever height you want for whatever row. Something like:
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
if ( indexPath.row == 0 ) // 1st row
return 25.0;
else
return 35.0;
}