1.让 UITableView 的 headerView跟随 cell一起滚动
//多个session 设置 UITableView 类型为 grouped 此时,cell 都被加了分割线
let table = UITableView(frame: .zero, style: .grouped)
// 取出分割线
table.separatorStyle = .none
//单一session 建议将 headerView添加在UITableView 上
tableView.tableHeaderView=header
2. iOS 11 tableView刷新界面 上跳闪烁
// 在AppDelegate 内添加 修复 tableview刷新是上跳闪烁
if #available(iOS 11.0, *) {
UITableView.appearance().estimatedRowHeight = 0;
UITableView.appearance().estimatedSectionFooterHeight = 0;
UITableView.appearance().estimatedSectionHeaderHeight = 0;
UITableView.appearance().contentInsetAdjustmentBehavior = .never
}
3. iOS 11 scrollToRow 滚不到最后一行
/// 滚动不到底部
tableView.estimatedRowHeight = 0
tableView.estimatedSectionFooterHeight = 0
tableView.estimatedSectionHeaderHeight = 0
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。