iOS移动开发iOS学习开发

撩一撩小妖精tableView的进阶属性(六一版)

2016-06-01  本文已影响116人  奔哥小木屋

(六一福利)

一 小妖精的部分属性

本篇以竖直方向为主

  1. 什么是tableView的内容(content)
  • cell
  • tableHeaderView/tableFooterView
  • sectionHeader/sectionFooter

TabV: 这些才是俺的内容, 别的可不是

  1. contentSize.height : 内容的高度

  2. contentOffset.y : 内容的偏移量(frame的top - content的top)

  3. contentInset : 内容周边的距离(内边距)

  4. Frame 可视范围

  • frame.size.height : 矩形框的高度
  • frame : 以父控件内容的左上角为坐标原点
  1. 以上这些, 看下面的图


    图0

二 小妖精的各种常见情景

  1. 没有cell, 没有contentInset, 没有tableHeaderView/tableFooterView,类似:


    图1
  1. 没有cell, 没有contentInset, 有tableHeaderView/tableFooterView,类似:


    图2
  1. 有cell, 没有contentInset, 没有tableHeaderView/tableFooterView, 类似图0, 这里就不上图了.
  1. 有cell, 有contentInset, 没有tableHeaderView/tableFooterView, 比如:


    图3
  1. 有cell, 没有contentInset, 有tableHeaderView/tableFooterView, 如


    图5
  1. 有cell, 有contentInset, 有tableHeaderView/tableFooterView, 如


    图6
  1. 有cell, 没有contentInset, 没有tableHeaderView/tableFooterView, 但是有额外的子控件{0, -44, 375, 44},如


    图7
  1. 有cell, 没有contentInset, 有tableHeaderView/tableFooterView, 但是有额外的子控件{0, -44, 375, 44}, 如


    图8
  1. 有cell, 有contentInset, 有tableHeaderView/tableFooterView, 但是有额外的子控件{0, -44, 375, 44}, 如


    图9
上一篇 下一篇

猜你喜欢

热点阅读