How to make a custom drawn UITableViewCell resize properly?

前端 未结 4 2177
孤城傲影
孤城傲影 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:57

    I had a similar problem with a UIView inside a UITableViewCell. I solved it by changing the UIView's contentMode to UIViewContentModeLeft. (I wrote it up here, with screenshots.)

提交回复
热议问题