Hi, i need to change TextXolor of a Label and i can take the color from a variable
B4X:
Dim ColActive As ColorDrawable
Dim ColInactive As ColorDrawable
ColActive.Initialize(Colors.black, 10dip)
ColInactive.Initialize(Colors.LightGray, 10dip)
Label1.textcolor=ColActive
Label2.textcolor=ColInactive
Label3.textcolor=ColInactive
.....
Label99.textcolor=ColInactive
Label100.textcolor=ColActive
I have an errore on Label1.textcolor=ColActive and Label2.textcolor=ColInactive
Someone can help me?
Marco
ColorDrawable is for background. You need to use something like this:
B4X:
Dim colActive As Int =Colors.Black
Dim colInactive As Int =Colors.LightGray
Label1.textcolor=ColActive
Label2.textcolor=ColInactive
Label3.textcolor=ColInactive
Private Const colActive As Int = Colors.Black
Private Const colInactive As Int = Colors.LightGray
'you can also define more colors than the built in Colors
Private Const colActive As Int = Colors.RGB (0,139,139)