cancel
Showing results for 
Search instead for 
Did you mean: 

Touches propagating through containers

JHarding
Senior

I have multiple containers on the screen at any given time. Most of the time, these containers are on top of each other. Today I just noticed that touching on the top container, will sometimes click a button on the container below it. How can I stop this from happening?

4 REPLIES 4
Martin KJELDSEN
Chief III

How are these containers structured? If you have a background in each that has setTouchable(false); then nothing will fall through. As long as they're overlapping but the top container does not have anything on the entirity of its "canvas" to stop touches from falling through...

/Martin

JHarding
Senior

I have a base class called settings menu. This class has a background, a header icon, and a back button and it also controls the menu popping in an out. All of my settings menus extend this base class, and add functionality necessary. The base classes background is a touchgfx::Box and is called mBackgroundBox, I call the function mBackgroundBox.setTouchable(false), yet the touches are still propagating through to the other settings menus behind it.

Any other thoughts?

Edit: Added clarifications

JHarding
Senior

@Martin KJELDSEN​ This is still an issue. Do you have any other ideas?

CButz.1
Associate III

I know its a old question, but i just stumbled across it, setTouchable needs to be true or else the touches "fall through".