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.
0
votes
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.
instead of doing this:
Here, the button
comes under the scrollView
. This is incorrect.
button
to theview
containing thescrollView
rather than adding it to thescrollView
itself. – GoGreen