Android Question [Solved]Buttons show through panels

DataMiser

Member
Licensed User
I was playing around with using panels to overlay a portion of the display. To my surprise when the program runs on the device buttons behind the overlay panel show through and in at least some cases the panel had buttons in the same location and the buttons that I would think should have been cover by both the panel and the other buttons still show on the screen rather than the buttons on the overlay.

In VB there is the zorder method at runtime and the bring to front/ send to back methods in the designer but I do not see anything like this so far n B4A. So the question is am I just missing something or is this just the way it works and I need to either make the buttons invisible when I don't want them displayed or alter the overall design?
 

DataMiser

Member
Licensed User
Ok so I see that there is a method for bring to front and send to back on the controls via code but that does not seem to stop the button from showing through a panel
 
Upvote 0

DataMiser

Member
Licensed User
hmm... I would not have though of that but did not seem to work in this little test project I am working with.

I have a sample dialog I downloaded from the forum it just has a button on the main activity layout then when the button is pressed shows an input dialog in the center of the screen. On my tablet the button is in the same general area and shows through the dialog panel.

The panel elevation was at 0, I changed it to 4 then tried it at 7. Same results in all three cases?? Button still showing through.
 
Upvote 0

DataMiser

Member
Licensed User
In this case no, the panel is part of the dialog. basically there is an activity layout with a single button as the only view on the layout.
That button calls code in a class module that displays a dialog which has a layout made up of a panel with an icon, a label, a edittext and 2 buttons.

When called the parent is set to the activity that called it.

I'll play around a bit and see what results I can get in other cases
 
Upvote 0

DataMiser

Member
Licensed User
I did set the elevation of the panel in the layout which the class uses to 4 and then tried it at 7. Results unchanged.
Is this what you mean or are you speaking of another method?

I also tried adding a panel to the main layout and see that the elevation setting does cover the button on the main layout so that is a step forward. Thanks

I also moved the button to the new panel and set that panel as the parent of the dialog but still button shows through dialog
 
Upvote 0

DataMiser

Member
Licensed User
Ok I think I got it now. I created a panel on the main layout, placed the button in the panel. Set the panel elevation to 0
I then used activity as the parent for the dialog call and have the panel in the dialog layout set to elevation of 4.

Now when I run the program the dialog covers the button as desired.

Thanks for the help
 
Upvote 0
Top