Tip:

p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; line-height: 14.0px; font: 12.0px Times; min-height: 14.0px }
p.p2 { margin: 0.0px 0.0px 0.0px 0.0px; line-height: 14.0px; font: 12.0px "Songti SC" }
p.p3 { margin: 0.0px 0.0px 0.0px 0.0px; line-height: 14.0px; font: 12.0px Times }
span.s1 { }
span.s2 { font: 12.0px "Songti SC" }
span.s3 { font: 12.0px Times }
td.td1 { width: 85.0px; margin: 0.5px 0.5px 0.5px 0.5px; padding: 1.0px 1.0px 1.0px 1.0px }
td.td2 { width: 689.0px; margin: 0.5px 0.5px 0.5px 0.5px; padding: 1.0px 1.0px 1.0px 1.0px }
p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; line-height: 14.0px; font: 12.0px Times; min-height: 14.0px }
p.p2 { margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Times; min-height: 14.0px }
p.p3 { margin: 0.0px 0.0px 0.0px 0.0px; line-height: 14.0px; font: 12.0px "Songti SC" }
p.p4 { margin: 0.0px 0.0px 0.0px 0.0px; line-height: 14.0px; font: 12.0px "Times New Roman"; min-height: 15.0px }
p.p5 { margin: 0.0px 0.0px 0.0px 0.0px; text-align: justify; line-height: 14.0px; font: 12.0px Times }
p.p6 { margin: 0.0px 0.0px 0.0px 0.0px; text-align: justify; line-height: 14.0px; font: 12.0px "Times New Roman"; min-height: 15.0px }
p.p7 { margin: 0.0px 0.0px 0.0px 0.0px; text-align: justify; line-height: 14.0px; font: 12.0px "Songti SC" }
p.p8 { margin: 0.0px 0.0px 0.0px 0.0px; text-align: justify; line-height: 14.0px; font: 12.0px "Times New Roman" }
p.p9 { margin: 0.0px 0.0px 0.0px 0.0px; text-align: justify; font: 12.0px "Times New Roman"; min-height: 15.0px }
span.s1 { }
span.s2 { font: 12.0px "Songti SC" }
span.s3 { font: 12.0px Times }
span.s4 { font: 12.0px "Times New Roman" }
table.t1 { width: 774.0px; border-collapse: collapse }
td.td1 { width: 85.0px; border-style: solid; border-width: 1.0px 1.0px 1.0px 1.0px; border-color: #cbcbcb #cbcbcb #cbcbcb #cbcbcb; padding: 0.0px 5.0px 0.0px 5.0px }
td.td2 { width: 689.0px; border-style: solid; border-width: 1.0px 1.0px 1.0px 1.0px; border-color: #cbcbcb #cbcbcb #cbcbcb #cbcbcb; padding: 0.0px 5.0px 0.0px 5.0px }

p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; line-height: 14.0px; font: 12.0px Times; min-height: 14.0px }
p.p2 { margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Times; min-height: 14.0px }
p.p3 { margin: 0.0px 0.0px 0.0px 0.0px; line-height: 14.0px; font: 12.0px "Songti SC" }
p.p4 { margin: 0.0px 0.0px 0.0px 0.0px; line-height: 14.0px; font: 12.0px "Times New Roman"; min-height: 15.0px }
p.p5 { margin: 0.0px 0.0px 0.0px 0.0px; text-align: justify; line-height: 14.0px; font: 12.0px Times }
p.p6 { margin: 0.0px 0.0px 0.0px 0.0px; text-align: justify; line-height: 14.0px; font: 12.0px "Songti SC" }
p.p7 { margin: 0.0px 0.0px 0.0px 0.0px; text-align: justify; line-height: 14.0px; font: 12.0px "Times New Roman" }
p.p8 { margin: 0.0px 0.0px 0.0px 0.0px; text-align: justify; line-height: 14.0px; font: 12.0px "Times New Roman"; min-height: 15.0px }
p.p9 { margin: 0.0px 0.0px 0.0px 0.0px; text-align: justify; font: 12.0px "Times New Roman"; min-height: 15.0px }
span.s1 { }
span.s2 { font: 12.0px "Songti SC" }
span.s3 { font: 12.0px Times }
span.s4 { font: 12.0px "Times New Roman" }
table.t1 { width: 774.0px; border-collapse: collapse }
td.td1 { width: 85.0px; border-style: solid; border-width: 1.0px 1.0px 1.0px 1.0px; border-color: #cbcbcb #cbcbcb #cbcbcb #cbcbcb; padding: 0.0px 5.0px 0.0px 5.0px }
td.td2 { width: 689.0px; border-style: solid; border-width: 1.0px 1.0px 1.0px 1.0px; border-color: #cbcbcb #cbcbcb #cbcbcb #cbcbcb; padding: 0.0px 5.0px 0.0px 5.0px }

属性

frame-------------设置控件的位置和大小

backgroundColor-------------设置控件的颜色

style-------------获取表视图的样式

dataSource-------------设置UITableViewDataSource的代理

delegate-------------设置UITableViewDelegate代理

sectionHeaderHeight-------------设置组表视图的头标签高度

sectionFooterHeight-------------设置级表视图的尾标签高度

backgroundView-------------设置背景视图,只能写入

editing-------------是否允许编辑,默认是NO

allowsSelection-------------在非编辑下,行是否可以选中,默认为YES

allowsSelectionDuringEditing-------------控制某一行时,是否可以编辑,默认为NO

allowsMultipleSelection-------------是否可以选择多行,默认为NO

allowsMutableSelectionDuringEditing-------------在选择多行的情况下,是否可以编辑,默认为NO

sectionIndexMinimumDispl  ayRowCount-------------显示某个组索引列表在右边当行数达到这个值,默认是NSInteger的最大值

sectionIndexColor-------------选择某个部分的某行改变这一行上文本的颜色

sectionIndexTrackingBackgroundColor-------------设置选中某个部分的背景颜色

separatorStyle-------------设置单元格分隔线的样式

separatorColor-------------设置选中单元格分隔线的颜色

tableHeaderView-------------设置组表的头标签视图

tableFooterView-------------设置组表的尾标签视图

UITableView类目属性

section-------------获取当前在哪个组内

row-------------获取当前单元格是第几行

方法:

初始化方法:

initWithFrame:-------------设置表的大小和位置

initWithFrame:style-------------设置表的大小,位置和样式(组,单一)

setEditing:-------------表格进入编辑状态,无动画

setEditing: animated:-------------表格进入编辑状态,有动画

reloadData-------------刷新整个表视图

reloadSectionIndexTitles  -------------刷新索引栏

numberOfSections-------------获取当前所有的组

numberOfRowsInSection:-------------获取某个组有多少行

rectForSection:-------------获取某个组的位置和大小

rectForHeaderInSection:-------------获取某个组的头标签的位置和大小

rectForFooterInSection:-------------获取某个组的尾标签的位置和大小

rectForRowAtIndex:-------------获取某一行的位置和大小

indexPathForRowAtPoint-------------点击某一个点,判断是在哪一行上的信息。

indexPathForCell:-------------获取单元格的信息

indexPathsForRowsInRect:-------------在某个区域里会返回多个单元格信息

cellForRowAtIndexPath:-------------通过单元格路径得到单元格

visibleCells-------------返回所有可见的单元格

indexPathsForVisibleRows  -------------返回所有可见行的路径

headerViewForSection:-------------设置头标签的视图

footerViewForSection -------------设置尾标签的视图

beginUpdates-------------只添加或删除才会更新行数

endUpdates-------------添加或删除后会调用添加或删除方法时才会更新

insertSections:withRowAnimation:-------------插入一个或多个组,并使用动画

insertRowsIndexPaths:withRowAnimation:-------------插入一个或多个单元格,并使用动画

deleteSections:withRowAnimation:-------------删除一个或多个组,并使用动画

deleteRowIndexPaths:withRowAnimation:-------------删除一个或多个单元格,并使用动画

reloadSections:withRowAnimation:-------------更新一个或多个组,并使用动画

reloadRowIndexPaths:withRowAnimation:-------------更新一个或多个单元格,并使用动画

moveSection:toSection:-------------移动某个组到目标组位置

moveRowAtIndexPath:toIndexPath:-------------移动个某个单元格到目标单元格位置

indexPathsForSelectedRow -------------返回选择的一个单元格的路径

indexPathsForSelectedRows-------------返回选择的所有的单元格的路径

selectRowAtIndexPath:animation:scrollPosition-------------设置选中某个区域内的单元格

deselectRowAtIndexPath:animation:-------------取消选中的单元格

重用机制

dequeueReusableCellWithI  dentifier:-------------获取重用队列里的单元格

UITableViewDataSource代理方法:

方法:

numberOfSectionsInTableView:-------------设置表格的组数

tableView:numberOfRowInSection:-------------设置每个组有多少行

tableView:cellForRowAtIndexPath:-------------设置单元格显示的内容

tableView:titleForHeaderInSection:-------------设置组表的头标签视图

tableView:titleForFooterInSection:-------------设置组表的尾标签视图

tableView:canEditRowAtIndexPath:-------------设置单元格是否可以编辑

tableView:canMoveRowAtIndexPath:-------------设置单元格是否可以移动

tableView:sectionIndexTitleForTableView:atIndex:-------------设置指定组的表的头标签文本

tableView:commitEditingStyle:forRowAtIndexPath:-------------编辑单元格(添加,删除)

tableView:moveRowAtIndexPath:toIndexPath-------------单元格移动

UITableViewDelegate代理方法:

tableView: willDisplayCell:

forRowAtIndexPath:-------------设置当前的单元格

tableView: heightForRowAtIndexPath:-------------设置每行的高度

tableView:tableViewheightForHeaderInSection  :-------------设置组表的头标签高度

tableView:tableViewheightForFooterInSection  :-------------设置组表的尾标签高度

tableView: viewForHeaderInSection:-------------自定义组表的头标签视图

tableView: viewForFooterInSection: -------------自定义组表的尾标签视图

tableView:accessoryButtonTappedFor  RowWithIndexPath:-------------设置某个单元格上的右指向按钮的响应方法

tableView:

willSelectRowAtIndexPath  :-----------获取将要选择的单元格的路径

tableView:didSelectRowAtIndexPath:-----------获取选中的单元格的响应事件

tableView: tableViewwillDeselectRowAtIndexPath:------------获取将要未选中的单元格的路径

tableView:didDeselectRowAtIndexPath:-----------获取未选中的单元格响应事件

执行顺序如下:

第一轮:

1、numberOfSectionsInTableView  :假如section=2,此函数只执行一次,假如section=0,下面函数不执行,默认为1

2、heightForHeaderInSection,执行两次,此函数执行次数为section数目

3、heightForFooterInSection,函数属性同上,执行两次

4、numberOfRowsInSection,此方法执行一次

5、heightForHeaderInSection,此方法执行了两次,我其实有点困惑为什么这里还要调用这个方法

6、heightForFooterInSection,此方法执行两次,

7、numberOfRowsInSection,执行一次

8、heightForRowAtIndexPath ,行高,先执行section=0,对应的row次数

第二轮:

1、numberOfSectionsInTableView ,一次

2、heightForHeaderInSection,section次数

3、heightForFooterInSection,section次数

4、numberOfRowsInSection,一次

5、heightForHeaderInSection,执行section次数

6、heightForFooterInSection,执行section次数

7、numberOfRowsInSection,执行一次

8、heightForRowAtIndexPath,行高,先执行一次

9、cellForRowAtIndexPath

10、willDisplayCell

然后8、9、10依次执行直到所有的cell被描画完毕

UITableView的全部属性、方法以及代理方法执行顺序

p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; line-height: 14.0px; font: 12.0px Times; min-height: 14.0px }
p.p2 { margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Times; min-height: 14.0px }
p.p3 { margin: 0.0px 0.0px 0.0px 0.0px; line-height: 14.0px; font: 12.0px "Songti SC" }
p.p4 { margin: 0.0px 0.0px 0.0px 0.0px; line-height: 14.0px; font: 12.0px "Times New Roman"; min-height: 15.0px }
p.p5 { margin: 0.0px 0.0px 0.0px 0.0px; text-align: justify; line-height: 14.0px; font: 12.0px Times }
p.p6 { margin: 0.0px 0.0px 0.0px 0.0px; text-align: justify; line-height: 14.0px; font: 12.0px "Songti SC" }
p.p7 { margin: 0.0px 0.0px 0.0px 0.0px; text-align: justify; line-height: 14.0px; font: 12.0px "Times New Roman" }
p.p8 { margin: 0.0px 0.0px 0.0px 0.0px; text-align: justify; line-height: 14.0px; font: 12.0px "Times New Roman"; min-height: 15.0px }
p.p9 { margin: 0.0px 0.0px 0.0px 0.0px; text-align: justify; font: 12.0px "Times New Roman"; min-height: 15.0px }
span.s1 { }
span.s2 { font: 12.0px "Songti SC" }
span.s3 { font: 12.0px Times }
span.s4 { font: 12.0px "Times New Roman" }
table.t1 { width: 774.0px; border-collapse: collapse }
td.td1 { width: 85.0px; border-style: solid; border-width: 1.0px 1.0px 1.0px 1.0px; border-color: #cbcbcb #cbcbcb #cbcbcb #cbcbcb; padding: 0.0px 5.0px 0.0px 5.0px }
td.td2 { width: 689.0px; border-style: solid; border-width: 1.0px 1.0px 1.0px 1.0px; border-color: #cbcbcb #cbcbcb #cbcbcb #cbcbcb; padding: 0.0px 5.0px 0.0px 5.0px }

最新文章

  1. 今天有群友不是很清楚htm直接存数据库的危害,我简单举个例子
  2. Dell xps 13 9350待机时总是关机的处理方法
  3. jackson-mapper使用工具类
  4. 关于ubuntu下词典安装
  5. Java Annotation 机制源码分析与使用
  6. mariadb的explain分析及InnoDB存储引擎
  7. ios app - 打开系统设置URL
  8. careercup-树与图 4.4
  9. [LeetCode 119] - 杨辉三角形II(Pascal's Triangle II)
  10. yii2不用composer使用redis
  11. relative、absolute和float
  12. ASP.NET 应用程序(Application)生命周期概述
  13. Glide 这样用,更省内存!!!
  14. 2018-2019 ICPC, NEERC, Southern Subregional Contest
  15. ltp-ddt emmc_dd_rw
  16. LuoGu P2002 消息扩散
  17. iOS 证书申请和使用详解(详细版)阅读
  18. java List集合记录 ArrayList和LinkedList的区别
  19. 今日Q群:QQ群众群友反馈问题的归纳总结
  20. Java 子类父类构造方法执行顺序

热门文章

  1. requests库基本使用
  2. TIJ——Chapter Five:Initialization & Cleanup
  3. C++之路进阶——bzoj1821(部落划分)
  4. 转Windows Phone8.1 获取手机唯一识别码
  5. Spring的Ioc和AOP扩展
  6. PeopleSoft Home Subdirectories
  7. git操作笔记
  8. [转]在windows环境中使用varnish
  9. PHP获取时间、时间戳的各种格式
  10. 9. nginx服务实验笔记