-1

I have been working on a project where I need to implement a simple messaging / chatting UI. For test purposes, while using Lorem Ipsum I have noticed that, even after having a multiline label (and the label is acting as multiline) some of the texts are being cut off and shown three dots when running in smaller iPhones like SE or 5s. Like the following:

image showing truncating texts

But this doesn't occur if I run it in 8plus or 7plus.

After a lot of trial and error, I found that if I set the auto-shrink to minimum font scale or minimum font size the problem is solved. Like this:

image showing adjusted texts

But that makes the texts unequal sized to see. I don't know why its happening.

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
  • post pic of shrink text – Hitesh Agarwal Feb 28 '18 at 15:12
  • Sorry, I don't have enough reputation yet to add a photo directly. So I added links. Please click on the blue texts. @HiteshAgarwal – JAHID HASAN POLASH Feb 28 '18 at 17:58
  • I have to access your code for check what could be problem – Hitesh Agarwal Feb 28 '18 at 18:07
  • as I have mentioned the problem occurs only in smaller iPhones. it shows just fine in large phones such as 8plus or 7plus. I had a wild guess, maybe the height of the label is calculated according to per character height and total character count instead of number of lines and height. you can see some spaces wasted at the end of the first line and others. as the label is fixed font size it is causing trouble to adjust those additional spaces in the height. thus happening the cut off.. – JAHID HASAN POLASH Feb 28 '18 at 18:12
  • i can make a mock project and give you the git link. @HiteshAgarwal – JAHID HASAN POLASH Feb 28 '18 at 18:14

1 Answers1

0

I think you should label.numberOfLines = 0 and make Row height and Estimate to Automatic

enter image description here

Moayad Al kouz
  • 1,342
  • 1
  • 9
  • 19
  • i have done all that. but that didn't help. I have mentioned in the question that the multiline is happening. but inside the texts are srinking. – JAHID HASAN POLASH Feb 28 '18 at 18:00