Domanda

Basically, I want to be able to click all the Subviews in the Image below...

I want to be able to tap the Subviews of View B but View A is in the way even though View A Subviews are not blocking the views below. Is this possible? In other words I want to be able to tap through the transparent parts of a view even though its frame/bounds cover that area. View B is under View A in a ScrollView.

thanks, austin

Image showing an example

È stato utile?

Soluzione

The solution is to subclass View A (if it's not a custom view already) and override pointInside:withEvent.

Return YES if the specified point is inside one of View A's sub-views, or NO otherwise. When pointInside:withEvent returns NO the system will continue to try other views until it finds one that claims the point is inside it, then it will call hitTest:withEvent to see which inner-view to send the touches to (the default behaviour).

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top