iOS Question Panels transparent background behavior change in B4i V10

Nitin Joshi

Active Member
Licensed User
Longtime User
In my project, there are buttons spread across the screen. One strip of panel (pnlScrollLbl) is in the middle of the screen. Scrolling label's parent object is panel. Background of panel is transparent. In earlier B4i version, buttons behind the panel were working properly however since B4i V10 upgrade, buttons behind panel not working.

I have added below code as a solution. Is my method correct? or is there any other good option?

Panel Code:
Private pnlScrollLbl as B4XView
pnlScrollLbl.Visible=True
Dim vPnl As View = pnlScrollLbl
vPnl.UserInteractionEnabled = False
pnlScrollLbl.BringToFront
 

b4x-de

Active Member
Licensed User
Longtime User
In B4i (iOS) it is expected and correct behavior that a visible Panel placed above other views blocks all touch events, even if the panel itself does not implement any event handlers.

This is not a bug and not version-dependent.
It has worked this way since the first iOS versions and is part of UIKit’s fundamental hit-testing model.

iOS performs touch hit-testing from top to bottom in the view hierarchy.
The first visible view that matches the touch location wins.
Whether the view actually handles the event in user code is irrelevant.
A Panel in B4i is a UIView; if it is visible, it participates in hit-testing and blocks everything underneath.
So if a panel is visible, views below it will never receive touch events.
Although setting UserInteractionEnabled = False makes touches pass through, be aware of the following effects:

UserInteractionEnabled = False disables interaction for the entire view hierarchy below that panel.

That means: All buttons, text fields, gestures, etc. inside that panel stop working.
 
Upvote 0
Top