iOS Question UserInteractionEnabled only for parent

Alexander Stolte

Expert
Licensed User
Longtime User
Hello,

how can i only activiate the UserInteractionEnabled for the parent but not for the childs?
My problem is that the parent is hiding the events of other views over it (not the childs), the parent need no events.
 

Semen Matusovskiy

Well-Known Member
Licensed User
If you set UserInteractionEnabled = True for parent and UserInteractionEnabled = False for child, the parent view will receive events instead of child. This is absolutelly typical situation. Guess, you talk about another.
I can imagine following. RootPanel has two childs - Button1 and Panel1. Panel1 holds Button2 and covers Button1. You need events to Button1 and Button2, but Panel1 receives events instead of Button1. Well, you can change z-order (for example, using Button1.BringToFront).
 
Upvote 0

Alexander Stolte

Expert
Licensed User
Longtime User
gesture recognizer to handle events
This is not working if the parent's UserInteractionEnabled = false, the gesture events not firing on the childs.
however the base view should contain the other views.
I agree, but the problem is if i drag the card over the base width and height, then the card disappears into nothing because the base view ends.

Looks like I'm not going to find a solution to this problem. :(
 
Upvote 0
Top