Author Topic: Problem with BB-code in UILabel  (Read 2407 times)

xbelt

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 1
  • Posts: 9
    • View Profile
Problem with BB-code in UILabel
« on: August 18, 2014, 02:49:26 PM »
Hello,

I have a weird problem. I use heavy formatting with BB-codes but there seems to be a problem when formatting an opening bracket ('[').
If I have the following text in a UILabel:

  1. [008066]make[-] [0000FF]"[-][000000]col[-] [0000FF]1[-] [008066]setpw[-] [0000FF]:[-][000000]w[-] [008066]repeat[-] [0000FF]17[-] [000000][[-]  [008066]setpc[-]

Everything is correctly formatted except the '[' is not visible. The background of the label is somewhat grey
I hope someone can help me

Lukas

niall

  • Newbie
  • *
  • Thank You
  • -Given: 5
  • -Receive: 0
  • Posts: 13
    • View Profile
Re: Problem with BB-code in UILabel
« Reply #1 on: August 19, 2014, 08:31:01 AM »
You mean the black [ that comes after the 17?  I copy pasted that into a UILabel here and I can see it just fine?  Try creating a new label perhaps?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Problem with BB-code in UILabel
« Reply #2 on: August 19, 2014, 01:43:57 PM »
Make sure your NGUI is up to date as well.

xbelt

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 1
  • Posts: 9
    • View Profile
Re: Problem with BB-code in UILabel
« Reply #3 on: August 25, 2014, 04:09:23 AM »
I Am sorry it took me so long but I updated NGUI, created a new label and inserted the following text:
  1. [008066]to[-] [000000]test[-]
  2. [008066]repeat[-] [0000FF]12[-] [000000][[-] [008066]fd[-] [0000FF]100[-] [008066]rt[-] [0000FF]90[-] [000000]][-]
  3. [008066]end[-]
the result looks like:
http://puu.sh/b73EU/c409e70880.png
so the opening bracket is missing. These are the settings set on the label:
http://puu.sh/b73G1/3ab75aed4f.png

If I change the text to:
  1. [008066]to[-] [000000]test[-]
  2. [008066]repeat[-] [0000FF]12[-] [000000][ [-] [008066]fd[-] [0000FF]100[-] [008066]rt[-] [0000FF]90[-] [000000]][-]
  3. [008066]end[-]
(Adding a white space after the '[')
it works

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Problem with BB-code in UILabel
« Reply #4 on: August 26, 2014, 01:53:19 AM »
Thanks, it's a bug. I've fixed it on my end so it will be fixed in the next update.