Android Question B4XDialog elevation


Licensed User
Longtime User
"Having had" to study the source code of the XUI Views a bit, I noticed that, in the B4A version, the elevation of the Background panel of the B4XDialog has been set to 4dip. This is obviously a problem, if there was a View with higher elevation in the underlying layout (to avoid writing nonsense, I have experienced it, although I was practically certain).
  1. How to create this type of View, dialogs, that are certainly displayed above any other?
  2. What is the maximum elevation value that can be set?
  3. Although I think the answer will be "No"... is there more memory consumption by increasing this value (I ask because I don't know why this low value was chosen)?
  4. Finally, how to get the same thing (Background certainly above all) with B4I and B4J? (It seems to me that with these two nothing is done besides mParent.AddView (Background...)

Thank you.
Last edited:


B4X founder
Staff member
Licensed User
Longtime User
Elevation is an Android only feature. It was set to 4dip to appear above buttons which have an elevation of 2dip. There is of course no memory impact related to this value.

It could have been set to a higher value. I don't remember any case where it caused a problem before. You can also change it programmatically with:
Dim sf As Object = Dialog.Show(...)
Dialog.Base.Parent.As(Panel).Elevation = 100dip
Wait For ...
Upvote 0