开发者

Can I have different configuration of rows in different section of table view?

Can I have different configuration of rows in different section of table view?

This method doesn't 开发者_高级运维contains the section parameter:

-(UITableViewCell *)tableView:(UITableView *)tableView 
    cellForRowAtIndexPath:(NSIndexPath *)indexPath

So is it possible to do differently for different sections in the same table view?


Yes you can have different configuration in different section of view.

Actually indexPath.row will give you row index and indexPath.section will give you section index.

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
     NSLog(@"You are at row = %d and section = %d",indexPath.row,indexPath.section);
}

Depeneding on that two index you can specify different configurations.

Jim.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜