Layouts and events passing through

blong

Active Member
Licensed User
Longtime User
I have a program with a couple of different layout files and with buttons etc on each layout. The layouts occupy the entire screen size.

When I start program I load layout "main" which has some imageviews on bottom which act as buttons. One of these imageviews loads another layout which obscures the "main" layout. The second layout has further imageviews on bottom of page.

My problem is that when I tap hard (not sure why) on a part of the screen that obscure layout "main" imageviews then my TAP (click) is passed to layout main even though it is not visible as it is covered by a panel from 2nd layout.

How can this happen ... I assumed that layouts were like Windows forms and events would remain on the top layout ???

Help please.:sign0085:
 

kickaha

Well-Known Member
Licensed User
Longtime User
Are you loading the layouts direct to the activity? ie
B4X:
Activity.LoadLayout("main")
This can cause the issues you are having
The correct way is to load each layout to a panel, and switch them with the Visible property.

Klaus has an excellent tutorial here look at the TwoPanelLayouts example for what you need to do.
 
Upvote 0
Top