Hi guys,
I searched a lot about this topic but didn't find a suitable answer, only pieces of non-working code or oh-my-god non-working "solutions" (i.e. using textViewDidChange, beginUpdates, endUpdates methods) or similar cases (i.e. using a UILabel - I know that it works but I need an UITextView instead; or using sizeWithFont - I can't do that because the content is an HTML).
The problem is simple and I don't know why the answer seems so complicated.
I'm working on iOS 7. I built a XIB (linked to a UITableViewCell subclass) that contains a UITextView. These textviews in the table are populated with texts of different lengths. The width must not change, the height should.
The desired behaviour is that the height of the cell increases or decreases depending on the text length.
Do you guys have a working code or could you please link me a suitable tutorial or give me some hint?
Thank you very much .
I searched a lot about this topic but didn't find a suitable answer, only pieces of non-working code or oh-my-god non-working "solutions" (i.e. using textViewDidChange, beginUpdates, endUpdates methods) or similar cases (i.e. using a UILabel - I know that it works but I need an UITextView instead; or using sizeWithFont - I can't do that because the content is an HTML).
The problem is simple and I don't know why the answer seems so complicated.
I'm working on iOS 7. I built a XIB (linked to a UITableViewCell subclass) that contains a UITextView. These textviews in the table are populated with texts of different lengths. The width must not change, the height should.
The desired behaviour is that the height of the cell increases or decreases depending on the text length.
Do you guys have a working code or could you please link me a suitable tutorial or give me some hint?
Thank you very much .