How to make a custom drawn UITableViewCell resize properly?

前端 未结 4 1004
既然无缘
既然无缘 2021-02-09 11:19

For performance reasons, I draw the strings for my UITableViewCell in a custom view that overrides its drawRect method to draw strings directly in the view rectangle using NSStr

4条回答
  •  青春惊慌失措
    2021-02-09 11:53

    Try setting the contentMode of your own custom view (which resides inside the cell's contentView) to UIViewContentModeLeft. The "squeezing" is due to the fact that the default contentMode is UIViewContentModeScaleToFill.

提交回复
热议问题