Author Topic: UIToggle with UIWrapcontent  (Read 1750 times)

suifcd

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
UIToggle with UIWrapcontent
« on: May 30, 2016, 06:34:27 AM »
hi,
I have a problem when use UIToggle,i create list with UIWrapcontent,and list item has child gameobject ,addcomponent<UIToggle>(),set group 20,it has 2 date list ,share one item list,click button to change it.
First the ui show first list,2 item,click second item toggle,then click button to switch second list,there has 1 item,it not toggle true,click it .then click button to back the first list,2 item,2 of them are toggle true.
Any help
thanks

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIToggle with UIWrapcontent
« Reply #1 on: June 01, 2016, 08:34:16 PM »
It's very hard to understand your long run-on sentences, but the toggle should already be present on the elements of your UIWrapContent. You shouldn't be adding it at run-time. I suggest adding a Debug.Log to the UIToggle's Start() function to see if it's running through the "startsActive" part. I'm guessing it is, and you should do something about that such as explicitly setting UIToggle.value when updating UIWrapContent's elements.