Cannot update UI object's frame in UITableViewCell

后端 未结 6 1978
眼角桃花
眼角桃花 2021-01-19 02:18

I have a subclassed UITableViewCell.

I need to dynamically change the frame of a UILabel.

Here\'s what I\'ve done:

- (UITableViewCell *)table         


        
6条回答
  •  失恋的感觉
    2021-01-19 02:35

    Add a subview to cell.Content and resize that subview instead of the content itself. The cell will always be stretched to fit in your table view so you can't make it smaller.
    (and of course to make the cell height smaller just apply tableView:heightForRowAtIndexPath:)

提交回复
热议问题