Author Topic: ShrinkContent and line break problem  (Read 2290 times)

jonesey11

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
ShrinkContent and line break problem
« on: November 04, 2013, 11:32:49 AM »
I'm having an issue with the new "ShrinkContent" overflow on UILabels.

Basically, the behaviour I'm looking for is for a single line of text to shrink as more characters are added. To a point, this works. I set the height of the label such that it can be full-sized vertically when the text is short, and shrinks to accomodate more characters to a point.

However, once a certain length has been reached, the text actually moves to a 2nd line, which is not the behaviour I want. I have tried setting "Max Lines" to 1, but this simply causes the text to act like "ClampContent" once it can no longer contain the characters at full size.

Another workaround I tried is by simply adjusting the height of the UILabel so that it cannot actually accomodate the space for a second line at a smaller size. However, this has the undesirable consequence where, even when the string is quite short, the text size begins very small (as a result of the "squished" height.)

What I am looking for is a way to prevent the text from exceeding 1 line without cutting off the text on that 1st line. Any ideas?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: ShrinkContent and line break problem
« Reply #1 on: November 04, 2013, 12:02:19 PM »
This is a planned modification for the next version of NGUI. Currently max lines is being handled differently (it cancels the shrinking).

jonesey11

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Re: ShrinkContent and line break problem
« Reply #2 on: November 04, 2013, 12:04:43 PM »
Excellent, thank you for the response!