Author Topic: Resizing UITable with respect to parent UIScrollView.  (Read 1298 times)


  • Newbie
  • *
  • Thank You
  • -Given: 5
  • -Receive: 0
  • Posts: 19
    • View Profile
Resizing UITable with respect to parent UIScrollView.
« on: February 06, 2015, 09:55:26 AM »
I have a prefab featuring a vertical UITable 'inside' a vertical UIScroll View.

The table contains 10 elements.

I disable 2 of these elements from the middle of the UITable during runtime.

The UITable correctly closes the gaps and displays only the enabled elements.

However, the original overall height of the UITable is still considered by the containing UIScrollView to be valid, and instead of only allowing vertical scrolling to the bottom of the new UITable contents, it allows scroling past the contents and into a blank area which represents the vertical size of the 2 elements that have been removed.

What is the correct sequence of events required to 'inform' the UIScrolView that the UITable bounds has changed, and that it should redefine its limits accordingly?

Many thanks.

Edit - I think the logistical issue with the system, as far as my usage of it is concerned at least, is that all Reposition()ing appears to be deferred until Update. A check for UITable's disable state followed by a Reposition() of the UIScrollView  in the Update function of the script responsible for managing the contents of the UITable appears to get around the issue though.
« Last Edit: February 06, 2015, 10:25:39 AM by RobBrooks »