iphone/ipad开发之UITableView的方法

1.-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView;

//传入一个tableview

//返回tableview的区数

2. -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section;

//传入一个tableview和该tableview的特定分区section

 //返回该分区中行数

3. -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath;

 //传入一个tableview与该tableview的某行索引

//从索引路径获取分区和行,用来确定使用哪个值

 4. -(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section;

//传入一个tableview和该tableview的特定分区section

//返回每个分区的标题值,可以自定义,这里得到分区名

5.- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView;

//传入一个tableview

//返回该tableview的分区索引

6. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath

//点击一个cell后触发的事件


7. -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath 

 //设置行高

8.-(NSInteger)tableView:(UITableView *)tableView indentationLevelForRowAtIndexPath:(NSIndexPath *)indexPath;


//此方法将缩进级别设置为行号,返回缩进数字
 9.-(NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath; 

 //点击一个cell前触发的事件

10.-(UITableViewCellAccessoryType)tableView:(UITableView *)tableView accessoryTypeForRowWithIndexPath:(NSIndexPath *)indexPath {return UITableViewCellAccessoryDisclosureIndicator;} 

//每一行都显示一个展示按钮
 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值