Resizing UITextView in custom UITableViewCell

后端 未结 6 1469
天命终不由人
天命终不由人 2021-01-19 23:55

I have a custom UITableViewCell and I\'m trying to resize the UITextView inside it based on the content size. I\'m on iOS7 and using Autolayout.

6条回答
  •  南笙
    南笙 (楼主)
    2021-01-20 00:00

    try this

    set your UITextView outlet like this in your custom UITableViewCell class

    [yourTextView setAutoresizesSubviews:YES];
    yourTextView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
    

    hope this will work for you

提交回复
热议问题