1,最近项目中需要左滑多个按钮,最开始只是实现了
editActionsForRowAt
方法,在10.1,5s 5上都没有问题。但在8.3上无法左滑。 经过调试,只是调用了
func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) {
}
这个方法,只是调用而没有在方法中加入代码,成功解决问题
2,同样的问题出现在headerView,最开始采用注册tableViewHeaderOrFooterView,然后去重用,在8.3中展示内容不全。后来没有采用注册,而直接返回,完美解决
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
if section == 1 {
let view = SAMOrderProductSectionHeaderView.instance()
return view
}
return nil
}
- SAMOrderProductSectionHeaderView只是普通的UIView。