Multi-line UILabel and UITextView using storyboard, auto layout and swift

I am trying to add a multi-line UI shortcut as header followed by UITextView as content body.

I added UILabel and UITextView like this: -

enter image description here

The label specifies a line count of 0, character wrapping, and standard left, right, bottom, and top constraints. I've also set a minimum height limit, but that doesn't change anything. The UITextView below it has an upper limit for the label and left, right and bottom constraints for the view / layout guide.

The actual output is as follows: -

enter image description here

There should be 3 lines for this label, but it only shows 2 lines /

enter image description here

This label should have 2 lines and the text as "tricyclic antidepressants", but the last line is not displayed.

Is there something wrong with my preferences / restrictions?

thank

+3


source to share


2 answers


Do two things:



  • Increase the number of label lines
  • Set height constraint greater than or equal
+1


source


Make sure the top label "Vertical Compression Resistance" is higher than the text.



0


source







All Articles