Hello, I'm using a CustomView with AutoTextSizeLabel, I would like to change the text color by code, but I don't know how to do it... I saw in the tread for AutoTextSizeLabel Erel said to someone that asked the same thing to change its tipe to Public, I did it but nothing changed and CustomView1.color = Colors.Red keep giving an error...
How can I do it?
Thanks for your help
Massy
You need to change the text color for each child (label or AutoTextSizeLabel) or whatever you have in the custom listview. If this doesn't help post the code that you are using to create the CustomListView, it will make it easier to help.
I have a CustomView in the Designer panel named CustomView1 and it's "Custom Type" is setted on AutoTextSizeLabel.
Then in my Action I declare the CustomView in Sub Globals: Public CustomView1 As AutoTextSizeLabel and in Sub Activity_Create I assign the color with: CustomView1 .color = Colors.Red
Sorry I misread the question, I thought you were asking about a CustomListView.
To change the color of the label in the AutoTextSizeLabel you need to access the label it contains. You can add this sub to the AutoTextsizeLabel Class and it will change the color:
B4X:
Public Sub setTextColor(color As Int)
mLbl.TextColor = color
End Sub