esreli
esreli

Reputation: 5071

Placing custom layer over UIScrollView

I'm attempting to build a special UIScrollView where the content area will contain an image with bounds larger than the screen and the user will drag the scrollview around, changing what part of the image is visible.

I'm wondering - is it possible to build one where I can place a permanent & fixed layer over the scrollview's content area without the layer interfering with UIScrollView touches?

Essentially how it would stack up is:

1) UIScrollView content view layer

2) Overlayed custom layer

3) UIScrollView touch layer

When the user interacts with the scrollView's touch layer, the content view layer will move around and the overlayed custom layer will stay fixed.

Is this possible? Might you point me towards resources that could help me accomplish this goal?

Upvotes: 0

Views: 440

Answers (1)

Stephen Johnson
Stephen Johnson

Reputation: 5121

If you don't want the overlay to have any touch events you can disable user interactions with your layer by setting userInteractionEnabled on your view to NO.

Upvotes: 2

Related Questions