Insert object at the end of a scrollView

Hello,

 

I have a button that handles a function which makes and object and inserts it to a scrollview. My problem is that every time I press this button my object is created at the same position in the “y” axis and I want it to appear just under the last object created in the scrollview. Can someone help me with this? Id be very thankful.

Borja

You will probably need to get the .y of the last item inserted, which means keeping track of that object and then add some offset to it when adding your next item.  Then update your last item to the one you just inserted.

Thanks Rob, it worked!

You will probably need to get the .y of the last item inserted, which means keeping track of that object and then add some offset to it when adding your next item.  Then update your last item to the one you just inserted.

Thanks Rob, it worked!