Change Height of a UITableViewCell

后端 未结 5 1452
一整个雨季
一整个雨季 2021-02-13 04:36

I want to make a UITableViewCell bigger. How can I do this, I have tried adjusting its frame but nothing happens. What can I do?

5条回答
  •  你的背包
    2021-02-13 05:18

    You can do like this..

    //Change the Height of the Cell [Default is 44]:
    -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath*)indexPath
    {
      if (indexPath.section == 0) {
       if (indexPath.row == 1) {
         return 90;
       }
      }
      return 44;
    }
    

    I hope this will help you..

提交回复
热议问题