0

I have three UILabels inside a UIStackView which is inside a UITableViewCell. All my labels have lines set to 0. Problem is labels sometimes gets disappeared or shows partial texts.

Things I have tried:

  1. Embedded each label inside UIView and set Constraints to them so take full UIView size. In this case, StackView had both alignment and distribution set to fill.
  2. StackView set alignment set to leading and UIVIews had same setup as the first try.
  3. Tried without the StackView but still, Labels doesn't show full text or gets disappeared.

A sample Stackview setup I tried

My Setup

Output I am getting:

As seen on the image, Arabic texts get disappeared (Shown with red notation). Some English texts are show partially. (Shown in yellow)

My Output

Other answers on StackOverflow I followed:

  1. Multiline label in UIStackView
  2. Multiline label in UIStackView
  3. UIStackView and multi-line labels in a UITableViewCell
  4. Multi Line Labels and an Image with UIStackView

Try 1: From an answer:

According to the suggestion of Talha, I made the following changes

Try 1

But no luck. The output I got from the changes:

Try 1 Output

Ahsan Aasim
  • 1,177
  • 3
  • 14
  • 40
  • First - is there a reason you are using a XIB instead of a prototype cell? Second, show a screen-cap with all the arrows expanded in the outline so we can see ALL of your constraints. – DonMag Sep 19 '19 at 13:19

1 Answers1

1

Set the label's constraint to (top, left, right, bottom , equal hight). Then you have to change equal height constraint value "greater than equal" from the attribute inspector. Now change the label attributes "line break=word wrap" , "lines=0"

Talha Ahmed
  • 160
  • 1
  • 10