只設(shè)置section高度而不做其它處理時(shí),在OC下面找到
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section;
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section;
然后return 0.00001就可以了
但是,在swift中只是這樣設(shè)置,是無(wú)效的,還要做如下處理
public func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
return UIView.init()
}
public func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView.init()
}
這樣,就可將section的高度設(shè)置為0了。
不對(duì)的地方,還請(qǐng)各位多多指教。