Android Question Text color for ListView

Dario126

Member
Licensed User
Longtime User
I have white background of activity, and holo.light theme is used.

On activity there is Listview with default setup (default color, alpha 255, also tried with explicite white background color).

But fonts on list view are invisible because are also white. I tried to change it like this:

B4X:
    lvFileList.TwoLinesLayout.Label.TextColor=Colors.Black
    lvFileList.TwoLinesLayout.Label.TextSize=14
    lvFileList.TwoLinesLayout.SecondLabel.TextColor=Colors.Gray
    lvFileList.TwoLinesLayout.SecondLabel.TextColor=12

.. but nothing changes, fonts are still white (text is visible when clicked). It's same on simulator (genymotion) or real device.

Changing of textcolor for single line entries in ListView works ok ..

What's wrong?
 

stevel05

Expert
Licensed User
Longtime User
Are you setting the colors before filling the list?

A test project showing the problem would be useful so we an see exactly what you've done and make it easier to test it and help you.
 
Upvote 0

Dario126

Member
Licensed User
Longtime User
ListView is not on Panel. It's placed direct on Activity.
Colors and other properties are setup before list is filled.
I see that it's not same effect if two line entry has icon or not.

Test project is good idea. Here is it in attachement as ZIP, and screenshoot is also attached ..
This is copy-paste from same project:

B4X:
    lvFileList.Clear

    lvFileList.SingleLineLayout.Label.TextColor=Colors.Black
    lvFileList.SingleLineLayout.Label.TextSize=18
    lvFileList.SingleLineLayout.ItemHeight=60       
   
    lvFileList.TwoLinesLayout.Label.TextColor=Colors.Black
    lvFileList.TwoLinesLayout.Label.TextSize=14
    lvFileList.TwoLinesLayout.SecondLabel.TextColor=Colors.Gray
    lvFileList.TwoLinesLayout.SecondLabel.TextSize=12

    Dim bmp As Bitmap
    bmp = LoadBitmap(File.DirAssets, "Icon Close.png")

    lvFileList.AddSingleLine("Single line #1")
    lvFileList.AddTwoLines("Dual lines #1", "second line")
    lvFileList.AddTwoLinesAndBitmap("Dual lines #1", "second line", bmp)

Any idea what is problem here?
 

Attachments

  • ListView test, project export.zip
    9 KB · Views: 267
  • ListView test.png
    ListView test.png
    16.4 KB · Views: 441
Upvote 0

klaus

Expert
Licensed User
Longtime User
Add these lines:
B4X:
lvFileList.TwoLinesAndBitmap.Label.TextColor=Colors.Black
lvFileList.TwoLinesAndBitmap.Label.TextSize=14
lvFileList.TwoLinesAndBitmap.SecondLabel.TextColor=Colors.Gray
lvFileList.TwoLinesAndBitmap.SecondLabel.TextSize=12
You must also define the layout for TwoLinesAndBitmap !
 
Upvote 0
Top