美文网首页
TableView与navigation

TableView与navigation

作者: 傅里叶的幻想 | 来源:发表于2017-04-23 21:09 被阅读0次

contentoffset

是指tableview内容距离原点的距离,内容包扩cell+header+footer 不包括conteninset

navigation透明

tableviewVC会自动为tableview设置内边距(contentinset.top = 64)
此时contentoffset 为-64
设置

self.automaticallyAdjustsScrollViewInsets = NO

tableview会从屏幕的左上角为原点 进行计算 ,tableview.contentoffset 相当于y轴,高于(0,0)点以上的为正.

navigation 不透明

self.automaticallyAdjustsScrollViewInsets = YES

此时以navigation的左下角为原点,此时内边距contentinset.top = 0 contentoffset = 0

相关文章

网友评论

      本文标题:TableView与navigation

      本文链接:https://www.haomeiwen.com/subject/wrgyzttx.html