While designing my first app, I set a panel (pnlBasis) covering whole Activitiy Main in Layout "LyBasis". The panel has a gradienddrawable. Looks ok.
I would like this layout put as basis for all my activities for make them look uniform.
In this pnlBasis I want to load activity-specific panels with the necessary views. So I designed another layout ("LyPnlMain") with again a panel (pnlMain) with its color set to #00000000. (If alpha-channel is 0 I assume transparency - is that wrong?) (All Panels B4XView)
But I fail:
i think you want panel.background, not panel.color
B4X:
Dim transperson As ColorDrawable
transperson.Initialize(Colors.transparent,0)
panel.Background = transperson
if i set the color to #00000000, i get the dark gray. if i set the background to transparent, i get see through. i've never understood the difference, but when i want transparent, i go with background and a color drawable.
When you load a layout to a panel the root view ("activity") background is set to the panel. Either change the background in the layouts or set it after you load the layout:
2. "Change the background in the layouts...": I set the background from the activity in LyPnlMain to #00000000 (is it that, what you mean?), but still no transparence of the second layout.
OK Erel, I found it out now myself:
First in activity Main a panel1 over the whole screen. There I handle the colors.
In this a panel2, set to transparent, all that saved as Layer1 (I missed this step in my project, loadet layer2 in panel1, and that was the reason, it did not work.)
A new layer2, with a panel3 all over activity-size.
Load this layer2 in panel2.
Thank you for your help!