开发者

UIScrollView - resize only some of the subviews?

开发者 https://www.devze.com 2023-01-04 05:42 出处:网络
I have a UIScrollView with a UIView in it which contains Images and Buttons. Now, I try to achieve the following:

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 开发者_如何学JAVAand 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?


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).

0

精彩评论

暂无评论...
验证码 换一张
取 消