cancel
Showing results for 
Search instead for 
Did you mean: 

About Container

Mvill.17
Associate III

I draw a container in a screen over all the other controls (such as buttons etc).

Background buttons continue to respond to click event as they were in foreground.

In my opinion this is not correct: they should be disabled by default.

I had to put: setTouchable(true) in the container to have a right behaviour.

Is this a BUG?

2 REPLIES 2
Michael K
Senior III

To prevent button touches beneath containers, you can add the ClickListener mixin to the container. You don't have to add any other code. This way the topmost container only will capture the click event, and will essentially discard it.

This is handy for preventing the user from touching elements beneath Modal windows, for instance. I also use it for preventing hardfaults when dragging the dynamic graph widget!

Mvill.17, that is not a bug. This is the intention. The first touchable widget will receive the click event.

Of course you could discuss if a Container should collect events as default. But atm. it inherits the behaviour from Drawable, that it is not touchable.