How to make a custom drawn UITableViewCell resize properly?
iphone
Solution
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.)
Problem
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 NSString:drawInRect. This is similar to Apple's TableViewSuite Example 5-CustomTableViewCell. However, when I invoke setEditing on the cell to bring up the delete button, the view ends up with a squeezed appearance after the animation completes. To demonstrate this, invoke setEditing:YES on the CustomTableViewCell example mentioned above and observe the distortion. Is there any way around this or should I just revert back to using UILabels for my text?