I am experimenting with creating buttons and labels using code rather than the Designer but cant fathom how to assign certain properties to say a button. Eg. CornerRadius on a button. The property does not exist.
I discovered this bit of code
B4X:
Dim Gradient1 As GradientDrawable
Dim clrs(2) As Int
clrs(0) = Colors.RGB(255,165,0)
clrs(1) = Colors.RGB(255,255,255)
Gradient1.Initialize("TOP_BOTTOM",clrs)
Gradient1.CornerRadius = 20dip
@richard: In addition to Erel's link, here is the code you were looking for:
B4X:
Dim b as Button
b.initialize("b")
Dim Gradient1 As GradientDrawable
Dim clrs(2) As Int
clrs(0) = Colors.RGB(255,165,0)
clrs(1) = Colors.RGB(255,255,255)
Gradient1.Initialize("TOP_BOTTOM",clrs)
Gradient1.CornerRadius = 20dip
b.Background= Gradient1