Multiple lines of a label in a custom UITableviewCell

后端 未结 5 1664
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-19 23:34

I have searched around for any tip for my problem. But I cannot find a solution for this.

I have made a subclass of UITableviewCell (FeedCell). With one image and t

5条回答
  •  轮回少年
    2021-01-20 00:25

    For mutiline use the following:

    tweetCell.tweetText.numberOfLines = 0;
    [tweetCell.tweetText sizeToFit];
    

    for testing purpose set the height of row as 46.0f in the following method:

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

    I could not get the height issue fixed but this did give me a UILabel with multiple lines

提交回复
热议问题