Author Topic: UIPopupList selected text cleared after switching language  (Read 3249 times)

rextr

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 15
    • View Profile
Hi,

After we updated to latest version of NGUI (3.9.8) we encountered a weird issue. When we change the current language (Localization.language) , the text of the current selection of some UIPopupList (which has localized items in it) becomes invisible. When we click the PopupList we can see localized items correctly, but the text of the selection is empty. When we select one of the items from the dropdown, the selected text becomes visible again. (We use Unity 4.7.1)

I hope I could explained it clearly. Thanks.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIPopupList selected text cleared after switching language
« Reply #1 on: May 14, 2016, 06:13:42 PM »
When localization changes, UIPopupList.OnLocalize will be called, which calls TriggerCallbacks(), which in turn sets the UIPopupList.current value and notifies all listener delegates. The only time UIPopupList.current.value is valid, is during the TriggerCallbacks() function call. If you have your code do your own localization and try to get the popup list's value inside, it won't work anymore as the value is not going to be valid.