Urs
Urs

Reputation: 21

UIScrollView - resize only some of the subviews?

I have a UIScrollView with a UIView in it which contains Images and Buttons.

Now, I try to achieve the following:

When I zoom in the scrollView, only SOME of the content in the UIView should scale (namely, the images), the buttons should remain in the same size, but should be repositioned according to the new scale...

Think of a Google-map: When you zoom in and out, the map gets resized, but the pins don't.

I made the view in IB and I somehow think I need to adjust the autosizing-settings for the different subviews. Alas, whatever I try, the buttons keep resizing as well...

any ideas?

Upvotes: 2

Views: 1041

Answers (1)

Andy
Andy

Reputation: 14302

Have one UIScrollView that pans and zooms (the map part, in your analogy) and UIViews above it that move based on the contentOffset property of the UIScrollView and use the UIScrollViewDelegate to update the position of the buttons (or pins).

Upvotes: 1

Related Questions