-1
我想製作一個tableView,其中我想要第一個單元格頁腳和第二個單元格頭將被合併。我試圖將兩者都刪除,但仍然存在分隔線。刪除頁腳和頁眉之間的分隔線IOS
有沒有辦法可以刪除第一個單元格的頁腳和第二個單元格的標題之間的分隔符。
還有一兩件事,我想給高度與頁腳和頁眉 在
- (UIView*) tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
UIView* footerView = nil;
switch (section) {
case 0:
footerView = [[UIView alloc] initWithFrame: CGRectMake(0, 0, tableView.bounds.size.width, 0.01f)];
// footerView.backgroundColor = [UIColor greenColor];
break;
case 1:
{
footerView = [[UIView alloc] initWithFrame: CGRectMake(0, 0, tableView.bounds.size.width, 30)];
}
break;
case 2:
{
footerView = [[UIView alloc] initWithFrame: CGRectMake(0, 0, tableView.bounds.size.width, 30)];
}
break;
default:
break;
}
return footerView;
}
但仍然是兩個頁眉和頁腳的高度保持相同 我無法知道是什麼原因?
您需要實現下面的tableview委託方法返回頁腳高度 - (CGFloat的)的tableView:(UITableView的*)的tableView heightForFooterInSection:(NSInteger的)部分 { CGFloat的footerHieght = 30.0;如果(section == 0) footerHight = 1.0; } return footerHight; } –