-3

簡単な質問がありますが、整理できません。アプリケーションに がありUITableViewます。3 つのセクションがあり、各セクションには 3 つの行があります。

最初のセクションの最初のセルの高さを増やしたいです。これにはデリゲートを使用していますが、3 番目のセクションの最初のセルの高さが増加します。

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{    
    if (indexPath.row == 0 && sectionValue==0)
    {         
        sectionValue=1;
        180.0 を返します。        
    }
    そうしないと
    {
        44.0 を返します。        
    }   
}
4

2 に答える 2

2

直接使用できますindexPath.section-

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath 
{

    if (indexPath.row == 0 && indexPath.section==0) 
    {  
        return 180.0;

    }
    else
    {
        return 44.0;

    }
}
于 2012-07-03T11:40:44.373 に答える
0

これを試して......

 indexPath.section
于 2012-07-03T11:42:54.543 に答える