B4J Question [b4x] CustomListView Background color for unused area

MrKim

Well-Known Member
Licensed User
Longtime User
I have spent my requisite 2 hours searching the forum and trying all of the suggestions to no avail. I would like to set the color of the background for the unused area (circled in red) of a customlistview. B4J 9.30.
1690351471283.png

Thanks for any help.
 
Solution
I would like to set the color of the background for the unused area (circled in red) of a customlistview. B4J 9.30.
B4X:
Dim sp As ScrollPane = CustomListView1.sv
sp.Style="-fx-background:transparent;-fx-background-color:transparent;"

Then you just set the color of the xclv in the designer to your color or to transparent
1690359401843.png

Alexander Stolte

Expert
Licensed User
Longtime User
I would like to set the color of the background for the unused area (circled in red) of a customlistview. B4J 9.30.
B4X:
Dim sp As ScrollPane = CustomListView1.sv
sp.Style="-fx-background:transparent;-fx-background-color:transparent;"

Then you just set the color of the xclv in the designer to your color or to transparent
1690359401843.png
 
Upvote 1
Solution

Alexander Stolte

Expert
Licensed User
Longtime User
Can you solve a problem without knowing what we are talking about?
So I think you can see the problem quite well in the picture. He has added 2 items to the list and the rest is free space. I once had the same problem, so I had the solution ready.

Another solution would have been to add a stub item to the list using the XUIViewsUtils class:
B4X:
XUIViewsUtils.AddStubToCLVIfNeeded(CustomListView1,xui.Color_Red)
 
  • Wow
Reactions: zed
Upvote 0

TILogistic

Expert
Licensed User
Longtime User
B4X:
Dim sp As ScrollPane = CustomListView1.sv
sp.Style="-fx-background:transparent;-fx-background-color:transparent;"

Then you just set the color of the xclv in the designer to your color or to transparent
View attachment 144048
just a comment (CSSUtils)
B4X:
    Dim sp As ScrollPane = CustomListView1.sv
    CSSUtils.SetStyleProperty(sp, "-fx-background", "transparent")
    CSSUtils.SetStyleProperty(sp, "-fx-background-color", "transparent")
 
Upvote 0
Top