cusmar
cusmar

Reputation: 1913

How to make ScrollView translucent and content behind it interactive?

I have a View Controller which contains a map view (yellow view on image) with one button. I want to add a scroll view hover it to "fix" the map view at background and make content covers the map while scrolling.

Here is the views and constraints:

views

When I run the app, the scroll view doesn't work anymore and I can't interact with the map and button because the scroll view is hover it.

What should I do to fix it and have the behaviour I specified?

Upvotes: 0

Views: 389

Answers (1)

Shehata Gamal
Shehata Gamal

Reputation: 100503

Try to subclass scrollView and assign that class in IB

class PassThroughView: UIScrollView {

 override func pointInside(point: CGPoint, withEvent event: UIEvent?) -> Bool { 
        return false
    }
}

Upvotes: 1

Related Questions