0
votes

I have a ScrollView which shows an image which zoom at touch. I followed the code showed in "Reset UIScrollView to new frame dimensions after orientation change" by DJSK here in stackoverflow, it work perfect. My question is how to add buttons to show info of parts of this image, the buttons has to zoom together with the image and show an alert or message when pressed. I check and tested many questions about UIScrollView in the forum but no one work for me. Need Help.

1
you mean you want the button to stay at a fixed position? if thats the case then you can acheive this by adding the button to the view containing the scrollView rather than adding it to the scrollView itself.GoGreen
@GoGreen I drag the button to the ScrollView,but when RUN the picture stays on top of the button so I cannot click on it. :(Manolo

1 Answers

1
votes

If you want the button to stay at a fixed position, you can achieve this by adding the button to the view containing the scrollView, rather than adding it to the scrollView itself.

You may have to rearrange the button in the Document Outline, or else it would come under the scrollView and you maight not be able to click on the button at runtime.

Here is an image which depicts this:

Do this by dragging the button in the Document outline: In the image, the button comes under the container view hierarchy. this is correct.

enter image description here

instead of doing this: Here, the button comes under the scrollView. This is incorrect.

enter image description here