I have a scrollview with some images in it and I want to show a button under the images when one is pressed. I created a button object and when one of the images is clicked I anchor the button to the bottom of the image. This works fine except that if I scroll my view the clipping area doesn't affect my button because it's not "inside" the grid.
I tried to parent the object to the clicked image and then anchor it but I got a weird behaviour: the button's Y position keeps diminishing over time (thus going outside the screen) after doing that for some reason. I tried to parent the button and then call Reposition() on the grid but it didn't work, same behaviour.
So what's the correct way to parent a button object to a scrollview element dynamically?
Thanks