开发者

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

开发者 https://www.devze.com 2023-01-01 12:20 出处:网络
Can I have different configuration of rows in different section of table view? This method doesn\'t 开发者_高级运维contains the section parameter:

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

精彩评论

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