区别
什么是内容

有cell ,但没有设置 contentInset

有cell ,并且有contentInset

如上图片描述,无论tableView是否设置内边距 都不会影响 contentOffset、contentSize
有cell,没有contentInset,有tableHeaderview、tableFootView

有cell,有contentInset,有tableHeaderview、tableFootView

特殊情况 这个额外加进去的 不属于内容的部分 所以不影响contentSize与 contentInset

总结
1)tableView的frame就是可见范围的大小(一般都设置成窗口的大小)
2)有没有内边距 对于 tableview的 contentSize 和 contentOffset 是没有影响的
3)contentInset只对内容有效 也就是说 设置的值永远是相对于内容的与用户手动添加的可能会重合
网友评论