IOS学习之UITableView
来源:互联网 发布:电子签名生成器软件 编辑:程序博客网 时间:2024/05/16 05:38
UITableView的常见属性
//UITableView的样式
@property (nonatomic, readonly) UITableViewStyle style;
//UITableView的数据源
@property (nonatomic, assign) id <UITableViewDataSource> dataSource;
//UITableView的代理
@property (nonatomic, assign) id <UITableViewDelegate> delegate;
//UITableView的行高
@property (nonatomic) CGFloat rowHeight;
//UITAbleView每一组的头部高度
@property (nonatomic) CGFloat sectionHeaderHeight;
//UITableView每一组的尾部高度
@property (nonatomic) CGFloat sectionFooterHeight;
//UITableView下划线的样式
@property (nonatomic) UITableViewCellSeparatorStyle separatorStyle;
//UITableView表格的头部控件
@property (nonatomic, retain) UIView *tableHeaderView;
//UITableView表格的底部控件
@property (nonatomic, retain) UIView *tableFooterView;
UITableView的UITableViewDataSource数据源代理方法
- (NSInteger)numberOfSectionsInTableView:(UITableView*)tableView;
//调用数据源的下面方法得知每一组有多少行数据- (NSInteger)tableView:(UITableView*)tableView numberOfRowsInSection:(NSInteger)section;
//调用数据源的下面方法得知每一行显示什么内容
- (UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath;
UITableView的UITableViewDelegate代理方法
//设置每一行的高度(如果每一行的高度不一致时使用此方法)
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath;
//设置每一组头部的高度
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section;
//设置每一组尾部的高度
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section;
* 如果实现了这个方法,就自动实现了滑动删除的功能
* 点击了删除按钮就会调用
* 提交了一个编辑操作就会调用(操作:删除\添加)
* @param editingStyle 编辑的行为 UITableViewCellEditingStyleNone, UITableViewCellEditingStyleDelete, UITableViewCellEditingStyleInsert
* @param indexPath 操作的行号
*/
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
UITableView的刷新方法
* 全局刷新(每一行都会重新刷新)
- (void)reloadData;
* 局部刷新(使用前提: 刷新前后, 模型数据的个数不变)
- (void)reloadRows:(NSArray *)indexPaths withRowAnimation:(UITableViewRowAnimation)animation;
* 局部删除(使用前提: 模型数据减少的个数 == indexPaths的长度)
- (void)deleteRowsAtIndexPaths:(NSArray *)indexPaths withRowAnimation:(UITableViewRowAnimation)animation;
- IOS学习之UITableView
- IOS学习之 UITableView
- IOS学习之UITableView
- ios学习之UITableView(一)
- IOS UI学习之UITableView
- iOS开发学习之UITableView
- iOS学习之UITableView…
- iOS学习之——UITableView详解
- iOS学习笔记之UITableView(1)
- [ios]iOS学习之UITableView(一): 新手篇创建tableView
- IOS UITableView 学习笔记
- IOS UITableView学习Demo
- ios学习:UITableView(一)
- iOS(学习) UITableView
- iOS 学习笔记 uitableView
- iOS学习之路-简易”IT之家“(UITableView)
- iOS学习笔记之UITableView之右侧索引
- IOS控件之UITableView
- Cocos2d-x 3.2 大富翁游戏项目开发-第十一部分 提升角色行走体验
- python下出现SyntaxError: Non-ASCII character '\xe5' in file 的解决办法
- hdu 5131 STL的应用+在线查询
- SSH框架之Hibernate(2)——三种状态
- 用 WEKA 进行数据挖掘,第 3 部分: 最近邻和服务器端库
- IOS学习之UITableView
- 带有EXISTS谓词的子查询
- Qt学习之路之解决中文乱码
- 有关Log4j设置日志文件位置的处理
- 教你如何一键批量删除空间说说
- linux编译wireshark源码
- HDU1286:找新朋友
- linux/windows下eclipse+gdb调试ndk程序
- eclipse tomcat 配置