I have searched the solution to this in the past QAs, but could not find the right one.
Does anyone know how to adjust aUILabel
size dynamically to fit the text length?
I have uploaded the screen shot of what I don't want(1st line) and what I want(2nd line).
I'd appreciate any clues, advice or code sample. Thank you.
Here's the step that work in mine: Set width constraint to the label, then click the constraint. Select Size Inspector. Set the relation to less than or equal, and set max width.
What you are searching is the UILabel method sizeToFit
I can try to explain to you, but the best answer to know how to work with UILabel is that: https://stackoverflow.com/a/1054681/666479
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With