Author Topic: UILabel missing some letters, Android only  (Read 5146 times)

gdagley

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
UILabel missing some letters, Android only
« on: November 02, 2015, 12:04:03 PM »
We have some labels that sometimes fail to render correctly when the game comes back from the background on Android.  The attached screenshots show one time with the missing letters and another time everything rendered correctly.  If the app is starting up, the labels will render correctly.  We only see this when coming back from the background on Android.  On iOS and in the editor, we never see this behavior.  I have also attached a screenshot of the label settings in case something shows itself in there.

Here is how the strings are being set for the labels. Logging them to the console shows that they are not missing any character and do not have any strange spacing initially.
 
  1.                 string offlineText = LocalizationManager.Instance.GetLocalizedText ("Welcome_Back_Description", "You were offline for {0} and earned");
  2.                 offlineText = string.Format (offlineText, GameHelpers.DoubleToTimeLongVersion ((float)totalSeconds));
  3.  
  4.                 offlineTimeLabel.text = offlineText;
  5.                 earnedAmountLabel.text = GameHelpers.FormatCost(amountEarned, GameConstants.CashType.Money);
  6.  

Unity 5.1.3p3
NGUI 3.7.8 (The app is in submission for iOS, so upgrading NGUI is only a possibility as a last resort.)

These are the only labels where we are seeing this which makes it even stranger to track down.  Hopefully someone else has seen this or has an idea of what I should look for to try and track down the cause.

gdagley

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
Re: UILabel missing some letters, Android only
« Reply #1 on: November 02, 2015, 05:56:54 PM »
I upgraded to the latest NGUI today just to see if that would fix the problem and it did not :(

This is happening on a Nexus 7 with Android 4.4.2, but I have seen it on a Nexus 4 with Android 5.1 as well.

gdagley

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
Re: UILabel missing some letters, Android only
« Reply #2 on: November 03, 2015, 11:23:43 AM »
Fixed this by moving the logic that changes the labels into a coroutine and waiting for the next frame.