Android Question (Resolved)ColorDrawable.Initialize2 problem

opus

Active Member
Licensed User
Hi,
I'm trying to build a panel with rounded corners and a border. I was expecting the .Initialize2 the give just that, but it doesn't do it (at least for me)

This is the code I'm using:
B4X:
Dim cd As ColorDrawable
cd.Initialize2( Colors.gray, 5dip, 2dip, Colors.DarkGray)
pnlOptions.Background=cd
I would expect a panel filled in Gray with a border colored in DarkGray and thickness 2Dip, Rounded Corners with a radius of 5Dip.
What I'm getting a transparent panel, no way to tell wether the corners a rounded....

When using
B4X:
Dim cd As ColorDrawable
cd.Initialize( Colors.gray, 5dip)
pnlOptions.Background=cd
The panel shows in DarkGray with rounded corners.

Are my expectations wrong or what...?
 

stevel05

Expert
Licensed User
It appears to work as expected here, what device are you testing it on?
 

opus

Active Member
Licensed User
Thanks for that hint. I'll try that when I'm back home.

Actually I'm using a workaround. I placed a second panel on top which is sligthly smaller. The result looks like a panel with titlebar and border.

And..Sorry for the late reply.
 

opus

Active Member
Licensed User
Happy New Year.

I tested it with a Alpha-Value of 255, its working that way. Thanks for the help.
 
Top