Adding a subview larger than cellHeight to a UITableViewCell?

后端 未结 4 1673
情歌与酒
情歌与酒 2020-12-30 04:45

I\'m trying to add a subview to a UITableViewCell and the design that I\'m working from demands that this particular subview (an image) needs to be larger than the actual UI

4条回答
  •  借酒劲吻你
    2020-12-30 05:18

    I actually had the opposite just yesterday, I had created a custom table cell and for some reason I got an overflow which I didn't want to have. My solution was to add the following code to my view controller class:

    - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
    {  
        return 175;
    }
    

    When it matched the height of the table cell there was no overlap; when it was too small there was overlap. Mind you though that I got very quicky behavious so I'm not sure it's a very good idea to do this.

提交回复
热议问题