Android Question Cover the button with the panel

strupp01

Active Member
Licensed User
Longtime User
I would like to darken an entire activity with a label, text field and buttons with a panel so that no button or text field can be clicked directly. Only the panel can be clicked on, so that an action takes place. This is also not possible for the label and text field with a button and IconButton. These are not covered. Why not ? What can I do to achieve this?
Greetings strupp01
 

klaus

Expert
Licensed User
Longtime User
The Panel must be on top of the other views.
You need to add an event for the Panel either Panel_Touch or Panel_Click even empty to consume the event and avoid that it's transmitted to the underlying views.
If you want views which could be accessed, they must be child view of the Panel.
 
Upvote 0

strupp01

Active Member
Licensed User
Longtime User
The IconButton is on Activity. The panel is then generated in code on Activity across the entire screen and brought up with Panel.BringToFront. It covers everything except the IconButton. If the panel is accessed via Panel_Click, the panel should be removed. This also works. As long as the panel exists, the IconButton should not react to a click event. I could set the IconButton Enabled, but I wanted to avoid this.
 
Upvote 0

strupp01

Active Member
Licensed User
Longtime User
I probably put it wrong. It looks like this.


Can operate the Icon Button (tick) with a click event, although covered by the panel. Not all other labels and buttons. Why? Just because he's on activity?
 
Upvote 0

strupp01

Active Member
Licensed User
Longtime User
I just did a test. When I put the IconButton (hook) on a panel, everything works as intended. However, if the IconButton is located directly on Activity, it is not covered by the panel.
 
Upvote 0

strupp01

Active Member
Licensed User
Longtime User
It's too big. Will create a mini program tomorrow and then post. The problem is as tested, a button on Activity cannot be covered with a panel in such a way that it cannot be selected. See you tomorrow, then
strupp01
 
Upvote 0

Jeffrey Cameron

Well-Known Member
Licensed User
Longtime User
Make sure the .Elevation property of the panel you wish to block with is higher than the Elevation property of buttons on the panel underneath.

 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…