Author Topic: Reset scrollview containing a UIGrid to top left  (Read 4321 times)

briangibson

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 26
    • View Profile
Reset scrollview containing a UIGrid to top left
« on: August 10, 2014, 01:20:18 PM »
I instantiate a bunch of UIGrid items on application start. I want to make sure that it scrolls immediately to the top left of the scrollview as soon as the app starts. what is the best way to do this? I tried all these things, and they don't seem to do it:
      scrollView.ResetPosition();
      scrollView.restrictWithinPanel = true;
      scrollView.RestrictWithinBounds(true);
      grid.repositionNow = true;



briangibson

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 26
    • View Profile
Re: Reset scrollview containing a UIGrid to top left
« Reply #1 on: August 10, 2014, 01:30:52 PM »

briangibson

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 26
    • View Profile
Re: Reset scrollview containing a UIGrid to top left
« Reply #2 on: August 17, 2014, 11:18:41 PM »
false alarm... this doesn't always work. =/ i'm baffled.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Reset scrollview containing a UIGrid to top left
« Reply #3 on: August 18, 2014, 11:51:25 AM »
When you enable or instantiate some UI element, it is not added to the panel right away. Scroll view has no knowledge of it at this point. You need to force it to happen right away by broadcasting "CreatePanel" on the object you instantiated.