How to make a custom drawn UITableViewCell resize properly?

前端 未结 4 2132
孤城傲影
孤城傲影 2021-02-09 11:17

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:48

    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.

提交回复
热议问题