避免|避免 tableView 显示不必要的 cell
【避免|避免 tableView 显示不必要的 cell】避免 tableView 显示不必要的 cell 有多种方法,下面这种则简洁高效。
// MARK: - Outlets
@IBOutlet internal var tableView: UITableView! {
didSet {
tableView.tableFooterView = UIView()
}
}
set tableView.tableFooterView to a blank UIView. This trick is to prevent the table view from drawing unnecessary empty table view cells, which is does by default after all the other cells are drawn.
设置 tableView.tableFooterView 为空的 UIView ,可以避免 tableView 显示不必要的 cell。
推荐阅读
- tableView|tableView 头视图下拉放大 重写
- #12-UITableView|#12-UITableView 优化方案
- iOS自适应高度的TableViewCell
- UITableView和UICollectionView的Cell重用问题
- 后端返回image的Buffer,显示图片
- RxSwift官方实例八(UITableVIew)
- Android实现未读消息小红点显示实例
- 球幕系统哪些是决定显示效果的关键因素()
- css|css中元素的显示与隐藏
- jvm常用命令