Android Question How to change a Label's border color with code?

Turbo3

Active Member
Licensed User
Longtime User
I have a label I need to change the border color depending on user input.

In B4i I use label.SetBorder(1,Colors."newcolor,"5) but when I try to map this to my Android app I can not find a "SetBorder" option on label. I don't need to change the width or radius just the color.
 

Mahares

Expert
Licensed User
Longtime User
You can use the color drawable:
B4X:
Dim MyBorder = Colors.Red As Int
    cd.Initialize2(Colors.RGB(Rnd(0,256),Rnd(0,256),Rnd(0,256)),5dip,4dip,MyBorder)
    Label1.Text="Powerful B4A"  
    Label1.background=cd
EDIT: Sorry, @mangojack had it ahead of me.
 
Last edited:
Upvote 0
Top