有没有办法减小UITableView的两个部分之间的空间?我拥有的每个部分之间大约有15个像素.我已经try 为-tableView:heightForFooterInSection:
和-tableView:heightForHeaderInSection:
返回0,但这不会改变任何事情.
有什么建议吗?
有没有办法减小UITableView的两个部分之间的空间?我拥有的每个部分之间大约有15个像素.我已经try 为-tableView:heightForFooterInSection:
和-tableView:heightForHeaderInSection:
返回0,但这不会改变任何事情.
有什么建议吗?
这有点棘手,但请try 以下代码:
- (CGFloat)tableView:(UITableView*)tableView
heightForHeaderInSection:(NSInteger)section {
if (section == 0) {
return 6.0;
}
return 1.0;
}
- (CGFloat)tableView:(UITableView*)tableView
heightForFooterInSection:(NSInteger)section {
return 5.0;
}
- (UIView*)tableView:(UITableView*)tableView
viewForHeaderInSection:(NSInteger)section {
return [[UIView alloc] initWithFrame:CGRectZero];
}
- (UIView*)tableView:(UITableView*)tableView
viewForFooterInSection:(NSInteger)section {
return [[UIView alloc] initWithFrame:CGRectZero];
}
相应地更改值.要删除空格,我认为0.0将不被接受.最小的理智值似乎是1.0.