Author Topic: 2.7.0 no linebreak with UILabel  (Read 1804 times)

aidji

  • Guest
2.7.0 no linebreak with UILabel
« on: October 03, 2013, 08:58:34 PM »
i just upgraded from 2.5.1 from 2.7.0, i setup my labels by code it was working well with one label for many lines but since the update the linebreak \n is not working anymore

did i missed something? how should i deal with this problem?

aidji

  • Guest
Re: 2.7.0 no linebreak with UILabel
« Reply #1 on: October 03, 2013, 11:41:29 PM »
well i checked and my last project with older NGUI version dont have this problem, seems that there is a bug or something with label changed?

i have an other panel with translated txt that work correctly for exemple:

  1. tuto7 = [SHIELD] It protect your \nbody from being Hit!
after being translated into the label display

  1. [SHIELD] It protect your
  2. body from being Hit!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: 2.7.0 no linebreak with UILabel
« Reply #2 on: October 04, 2013, 02:00:20 AM »
You need to do your own string.Replace("\\n", "\n") before setting the label's text. You're feeding it two characters for a newline, when a newline is a single escaped character (\n).