ListView Labels color

JMB

Active Member
Licensed User
Longtime User
Hi

I can't seem to set the label color for the Listview.TwoLinesLayout.Label or for the TwoLineLayout.SecondLabel.

I have tried everything I can think of...

I understand that you can't alter this once the ListView is up and running, but the COLOR property appears to be irrelevant.

Here's some code: First off is a bog standard label - this works fine, the label shows with a white background

lbllabel.Initialize("")
lbllabel.Color=Colors.White
lbllabel.TextColor=Colors.Red
lbllabel.Text="HI THERE"
activity.AddView(lbllabel,0,20,50%x,20%y)

And here's the ListView code:

Listview1.TwoLinesLayout.Color=colors.ARGB(255,0,0,53)

This makes no difference to the colour of the label inside the Listview layout.

Any clues? I have searched for this topic, but other topics mention TwoLines.TextColor, not .color

Thanks for any help.

Best regards

JMB
 

johnthomcode

Member
Licensed User
Longtime User
Hi,

I was just curious: can the labels be changed on a per item basis (row 1 is red, row 2 is green, etc.)?

Thanks!
 
Upvote 0

JMB

Active Member
Licensed User
Longtime User
Hi John

It's my understanding that you cannot change the label colours on a per-item basis.

If you set the colour of label1 to Red, then ALL Listview items will have a red label1

If you want more control, then you could use a scrollview and add your own items - for example a series of panels over which you have complete control.

It would appear that the problem I described at the start of this thread has been fixed in v1.41 onwards, and so will appear in the v1.5 release.

Hope this helps,

JMB
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…