Android Question Help with ListView color Label

CyclopDroid

Well-Known Member
Licensed User
Longtime User
I've a problem with color of the ListView label.
I use a AddSingleLine and the colors is really ok...but, at random (after AutoScrollview), the colors appears random.
Post image of my game in Debug:

Image1: In BreakPoint, the value colore is true (the word when I insert is incorrect);
1mo.jpg

Image2: The color it's TRUE
2do.jpg


Image3: After autoscrolling (SV.SetSelection(SV.Size)), the color changes mysteriously into White...but other times it's Green, Yellow, Red (the color when I use). :confused:
3a.jpg

Image4: When you see, the colors it's wrong. The word over the last ("rivela 3(x2)"), normally, is right and should be green, but it' view RED. (repeat...the wrong color appear random).
4a.jpg



I've insert a Log of the SV.SingleLineLayout.Label.TextColor (first I controll this, and other pass value to colore val) after autoscroll command "SV.SetSelection(SV.Size)", but the value when result i's TRUE (for RED -65536)...but the Label insert have another colors. :(
What is the problem?
Normally I have always worked... but now have this problem.
Thanks you for help.
See Ya.
 

DonManfred

Expert
Licensed User
Longtime User
Whenever you set/change the layout of one of the three layouts (single line, two lines and two line with bitmap) you set the layout for ALL items of this type. eg. If you change layout for single-line items you set the layout for ALL single-line items.
You can not use different colors for the same type of items.

You should use a customlistview instead. Here you can do it like you need here.
 
Upvote 0

CyclopDroid

Well-Known Member
Licensed User
Longtime User
But why the colors into my ListView is different? If you see the image, you can note when the other word have a real color when I insert... but, other word (not the first,second, etc) not have the color when I set.
If the I don't can use the different colors from the same item... why my listview have more colors? :confused:
I had already tried customview and scrollview, but notwere not going well... or I did not know use it :(
 
Last edited:
Upvote 0

udg

Expert
Licensed User
Longtime User
Hi,

as suggested in the Italian forum, try to put a listview.invalidate soon after you set the label color followed by a DoEvents.
This should force a complete redraw of your listview and the end result should be all the lines drawn with that same color.

Go with Manfred suggestion about the use of a CustomListView, a very useful component.

Umberto
 
Upvote 0
Top