I have a custom view for displaying application status messages that I slide over my table view as needed. This worked fine until I started customizing my table view cells.
When I manually assign a row height to my table view cells in initWithSTyle…
self.TableView.rowHeight = 64.0;
…the custom view doesn’t show up anymore.
I replaced the code above with a delegate method…
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
return 64.0;
}
…and now the custom view works as before.
Set
rowHeightin the view controller.I think
initWithStyleis too early to set the height. Eitherway, since your height is constant, it’s still more efficient to set the height once (inviewDidLoad) than set it every time for each cell created (ininitWithStyleorheightForRowAtIndexPath).