Custom Cell Row Height setting in storyboard is not responding

后端 未结 18 2125
名媛妹妹
名媛妹妹 2020-11-30 16:54

I am trying to adjust the cell height for one of the cells on my table view. I am adjusting the size from the \"row height\" setting inside the \"size inspector\" of the cel

18条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-30 17:14

    You can use prototype cells with a custom height, and then invoke cellForRowAtIndexPath: and return its frame.height.:.

    - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
    {
        UITableViewCell *cell = [self tableView:tableView
                        cellForRowAtIndexPath:indexPath];
        return cell.frame.size.height;
    }
    

提交回复
热议问题