ListView Label TextColor

JohannesPruellerJohannesPrueller USMember, University

Hey,

I've got some problems when using a ListView and a custom DataTemplate. In this DataTemplate I put a Grid and some Labels.
And there is my problem: I want to change the textcolor of some Labels, so I bind a Property where I validate which color the Labels should have. It works fine as long as i don't scroll, but after scrolling the color of the Labels are changing and "forget" about the bound Color.

Is this a known bug?

Answers

  • AdamPAdamP AUUniversity ✭✭✭✭✭

    What platform is this on and can you please post some code and/or xaml so we can see what is going on.

  • JohannesPruellerJohannesPrueller USMember, University

    I only tested it on Android - i will post some code later this day

  • Daniel.9388Daniel.9388 USMember
    edited May 2015

    I got almost the same problem. I got a ListView with a custom DataTemplate, which has a button and a label. I change the color of the button with the help of a bound property and this works perfectly.

    But once I scroll down and get back to the top, the colors are changing. They aren't even put to the default color : Some buttons should be gray and are blue, others should be blue and become gray. Any ideas ?

    Oh, and I tested on the Android platform for now.

  • Daniel.9388Daniel.9388 USMember

    @JohannesPrueller You have the problem with labels ? I only have the problem when using buttons, but labels don't change their color when I scroll down in the ListView. In my case, I'm changing the background color only.

  • JohannesPruellerJohannesPrueller USMember, University

    yes, my problem is that the textcolor of the labes changes everytime you scroll.
    It's really random what happens, because everytime you scroll, a different label's textcolor has changed

  • Daniel.9388Daniel.9388 USMember

    I got the exact same problem with my buttons, but not with my labels... And both have a custom DataTemplate and their properties bound the same way. I wonder why you got this problem and I don't...

    Which version of Android are you working on ? And did you try other controls such as buttons or else ?

  • JohannesPruellerJohannesPrueller USMember, University

    I've only tried it only on Android 5.0 and I didn't tried any other controls. But I think I'll test it and report as soon as possible :)

  • Daniel.9388Daniel.9388 USMember

    I made a thread to see if someone else has this kind of problem. It is really strange that you got problems that I don't. If you test with buttons please let me know, this way we could share some code and maybe find a solution. Thanks !

  • David_PilkingtonDavid_Pilkington USUniversity

    I have this issue as well. Is there any idea on what is causing it?

  • NawrinNawrin BDMember

    I have a reverse issue i guess, i want to change the color of my listview item on scrolling but its not changing. since i have tried "setCacheColorHint to transparent or white" but nothing changes. in the listview i have only text items. plz give ur suggessions. TIA.

Sign In or Register to comment.