UITableView的使用(UITableViewCell\section页眉\section页脚复用、sectionHeaderView点击效果)
来源:互联网 发布:淘宝售后在哪里查看 编辑:程序博客网 时间:2024/05/29 09:53
UITableView是列表视图,类似于QQAPP中联系人页面的功能。
UITableView是UIScrollView的子类,默认拥有UIScrollView的滚动功能,而不用设置contentSize
使用注意事项
1必须添加协议,以及实现代理方法
1-1 UITableViewDelegate 视图代理
1-2 UITableViewDataSource 数据源代理
2 初始化时,必须使用方法 - (instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style
3 列表类型UITableViewStyle设置时,注意差异,如:
3-1 UITableViewStyleGrouped,如果有多个section时,当前section页眉不会在最顶端显示
3-2 UITableViewStylePlain,如果有多个section时,当前section页眉会在最顶端显示
4代理方法实现中,注意相同功能代理方法实现的冲突,如:
4-1 - (nullable NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section与 - (nullable UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section不能同时设置
4-2 - (nullable NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section与 - (nullable UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section不能同时设置
5、注意复用技术
5-1 UITableViewCell的复用
5-2 每个section中页眉视图的复用
5-3 每个section中页脚视图的复用
- UITableView的使用(UITableViewCell\section页眉\section页脚复用、sectionHeaderView点击效果)
- UITableView的使用(UITableViewCell\section页眉\section页脚复用、sectionHeaderView点击效果)
- UITableView section圆角效果
- UITableView 的一些效果 透明和section的高度
- 去掉UITableView Section上Header的粘滞效果
- 如何禁止UITableView的section停留(去除卡住的效果)
- UITableView带section的使用(可写通讯录)
- 自定义Section:修改UITableView的Section的背景和字体
- 自定义Section:修改UITableView的Section的背景和字体
- IOS_设置UITableView Section的背景颜色和字体颜色(自定义section布局)
- 点击UITableviewCell中的Button打印cell属于的section和row
- iOS-UITableView使用reloadSections刷新section问题
- Section的使用
- 设置UITableView的section之间的距离
- 设置UITableView的section之间的距离
- 修改UITableView section header title的样式
- UITableview中隐藏静态section的方法
- UITableView刷新指定的row或者section
- struts2中 # % $ (井号,星号,百分号)的区别和用法
- 页面数据关闭,或刷新,或链接到其他页面提示有否保存数据
- CSS padding margin border属性详解(图解、赞)
- 二叉树的深度优先遍历(栈)和广度优先遍历(队列)
- hdu 1097 A hard puzzle 快速幂 找规律 H
- UITableView的使用(UITableViewCell\section页眉\section页脚复用、sectionHeaderView点击效果)
- MyBatis学习总结
- vc++ 将文件大小格式化
- 生产环境连接池和线程池配置参考
- 第七周项目4-队列数组
- 实现vs2013客户端服务器之间的简单通信,hello world 程序。
- 欢迎使用CSDN-markdown编辑器
- 很有用的自定义View详解教程
- 2016年第三季度总结