TableView 的方法详解
来源:互联网 发布:知豆电动汽车 电话 编辑:程序博客网 时间:2024/06/06 01:21
-、建立 UITableView
二、UITableView各Method说明
//Section总数
- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView{
}
// Section Titles
//每个section显示的标题
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section{
}
//指定有多少个分区(Section),默认为1
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
}
//指定每个分区中有多少行,默认为1
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
}
//绘制Cell
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *SimpleTableIdentifier = @"SimpleTableIdentifier";
}
//行缩进
-(NSInteger)tableView:(UITableView *)tableView indentationLevelForRowAtIndexPath:(NSIndexPath *)indexPath{
}
//改变行的高度
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
}
//定位
[TopicsTable setContentOffset:CGPointMake(0, promiseNum * 44 + Chapter * 20)];
//返回当前所选cell
NSIndexPath *ip = [NSIndexPath indexPathForRow:row inSection:section];
[TopicsTable selectRowAtIndexPath:ip animated:YES scrollPosition:UITableViewScrollPositionNone];
[tableView setSeparatorStyle:UITableViewCellSelectionStyleNone];
//选中Cell响应事件
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
}
//判断选中的行(阻止选中第一行)
-(NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
}
//划动cell是否出现del按钮
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
}
//编辑状态
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle
forRowAtIndexPath:(NSIndexPath *)indexPath
{
}
[topicsTable setContentSize:CGSizeMake(0,controller.promiseNum * 44)];
//右侧添加一个索引表
- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView{
}
//返回Section标题内容
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section{
}
//自定义划动时del按钮内容
- (NSString *)tableView:(UITableView *)tableView
titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath
//跳到指的row or section
[tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] atScrollPosition:UITableViewScrollPositionBottom animated:NO];
三、在UITableViewCell上建立UILable多行显示
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
}
//选中cell时的颜色
typedef enum {
} UITableViewCellSelectionStyle
//cell右边按钮格式
typedef enum {
} UITableViewCellAccessoryType
//是否加换行线
typedef enum {
} UITableViewCellSeparatorStyle//改变换行线颜色
tableView.separatorColor = [UIColor blueColor];
- TableView 的方法详解
- TableView代理方法详解(一)
- tableView的使用方法详解
- tableView的一些方法
- tableview的调用方法
- tableView的优化方法
- ios的tableView使用详解
- tableView的常用设置方法
- TableView的属性和方法
- 两个tableView联动的方法
- tableView的一些基本方法
- tableView的新cell方法
- tableview的一些常用方法
- tableview 详解
- TableView详解
- tableView详解
- TableView详解
- TableView详解
- 逝流年沧桑伤感日志_安静得,脑袋总在回忆从前
- Weka开发
- deleted object would be re-saved by cascade (remove deleted object from asso错误
- 【开源自动化测试疑难FAQ】【WebDriver】WebDriver对SWFUpload的无奈之举
- 文件的上传
- TableView 的方法详解
- <小白向>SH7218T分区调整教程
- mysql: unknown variable 'character_set_client=UTF8'
- MySql的一些常用查询函数(日期比较)
- Java调用硬件接口
- ubuntu10.04安装samba服务器
- STL容器学习总结
- 使用system函数
- 网址摘录