0
我想在UITableView中隐藏第一个区域的标题。因此,我在下面的函数中将高度设置为0。但标题仍显示?怎么了?如果我将它设置为例如1我在桌子上看到一条小线。有任何想法吗?在UITabllView中隐藏区域标题
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
if (section == 0) {
return 0;
} else {
return 18;
}
}
貌似http://stackoverflow.com/questions/1386826/uitableview-not-respecting-heightforheaderinsection-heightforfooterinsection – NathanAldenSr
的重复描述了同样的问题,但我发现了一个更好的解决方案(见下文)。 – Morpheus78