0

i have a table holding custom cells. in each cell there is a UILabel, which should show a text with a non fixed length. the label has a maximum size, let's say (150,30). it can show only one line of text.

What is the best practice in dealing with long texts?? should i reduce the size of the font? it doesn't look that good, since each row will have a different size.. should i trim the text at the end? then i'm not displaying everything. is there a simple way of animating the text to slide inside the Label ??

David Ben Ari
  • 2,259
  • 3
  • 21
  • 40

2 Answers2

1

You could maybe trim the text at the end and also make the UILabel clickable, by adding a transparent button over it. By touching the UILabel you could show an alert with the full text.. Alternatively you could add a button somewhere next to the text that would show the alert.

NikosM
  • 1,131
  • 7
  • 9
0

ok, so after a lot of tries and errors there isn't a magic answer.

I ended up forcing the text to be of a maximum size, it looks best, and in particular the user experience of long names was bad..

you could create a scrolling text label with: https://github.com/cbpowell/MarqueeLabel.git it didn't look good to my needs, but it can go well for other needs..

decreasing the text size on long labels is also one of the options, but if you have more than one label on the screen and their fonts are of different sizes it looks bad.

trimming the text is the worst..

David Ben Ari
  • 2,259
  • 3
  • 21
  • 40