iOS11适配 tableView顶部多一块 cell高度错误
2017-09-21 17:38
399 查看
之前的estimatedSection******Height默认为0,现在不为0了,直接写第一部分代码也可以,或者不设置estimatedSection,把代码2两个代理补上也行,看自己选择,本质原因就是因为默认值问题,这两种方式都可以解决这个默认值问题
default is UITableViewAutomaticDimension, set to 0 to disable
代码1
if (@available(iOS 11.0, *)) { self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; // est和代理 可选1个 self.tableView.estimatedSectionFooterHeight = 0; self.tableView.estimatedSectionHeaderHeight = 0; } else { self.automaticallyAdjustsScrollViewInsets = NO; }
代码2
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section { return nil; } - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { return nil; }
cell高度出现高度重合问题
self.tableView.estimatedRowHeight = 0;
default is UITableViewAutomaticDimension, set to 0 to disable
相关文章推荐
- 关于tableview中cell高度不同,用代码生成cell时常出现的错误
- iOS 设置 tableView 代理, 注册 cell, 自适应高度.
- tableview的顶部有一部分空白区域,并不是Cell的解决方法。
- 关于tableview 的cell 高度不一样的做法
- Swift iOS tableView static cell动态计算高度
- 【iOS知识学习】_iOS动态改变TableView Cell高度
- [iOS]TableView的Cell高度自适应
- iOS自动布局实现Cell和Tableview高度自适应(SDAutoLayout)
- ios开发笔记之如何让tableView根据文本内容动态改变cell的高度
- 关于静态cell实现tableView顶部与状态栏顶部平齐的问题
- tableview和cell高度自适应
- [IOS Tableview] cell自定义view显示错误问题
- IOS TableView的Cell高度自适应,UILabel自动换行适应(转载)
- Tableview中cell的自适应高度
- iOS开发中自定义tableView中某个cell的高度
- iOS8 tableView的Cell高度自适应开发
- tableview group cell xib创建,点击刷新高度+2的问题
- 58.UITableView:改变 TableHeaderView 的高度--跟随cell滚动
- [iOS]在tableview中用动画效果改变cell的高度
- IOS TableView的Cell高度自适应,UILabel自动换行适应