ListView Background

Omar

Member
Licensed User
Longtime User
Hello,

I have an Activity that has a lot of content on it and when a user clicks a button a ListView loads up.

The problem is that the ListView is loading transparent with all the images and buttons on the Activity showing in the background.

I have tried changing the options (Color, SetBackground, etc.) but no luck.

When scrolling the ListView becomes solid black but when released again transparent.

Will appreciate any help on this.
 

Omar

Member
Licensed User
Longtime User
Unfortunately it's not working, now the ListView remains transparent the entire time.

I actually wanted it to become solid black background.
 
Last edited:
Upvote 0

Omar

Member
Licensed User
Longtime User
Sure Erel.

Here is my code where I generate the ListView:

B4X:
   ListView1.TwoLinesLayout.ItemHeight = 80dip         
   ListView1.TwoLinesLayout.Label.Height = 50dip
   ListView1.TwoLinesLayout.SecondLabel.Height = 30dip
   ListView1.TwoLinesLayout.Label.TextSize = 16
   ListView1.TwoLinesLayout.SecondLabel.TextSize = 11
   ListView1.TwoLinesLayout.Label.Gravity = Gravity.CENTER_VERTICAL
   ListView1.TwoLinesLayout.SecondLabel.Gravity = Gravity.CENTER_VERTICAL
   ListView1.FastScrollEnabled = True
   ListView1.ScrollingBackgroundColor = Colors.Black
      
   For x = 0 To MList.Size - 1
   
               'Does loop to generate Data

      ListView1.AddTwoLines2(Title, "Rank: " & Rank & "  User Votes: " & Votes, URL)
   
   Next

   Activity.AddView(ListView1, 0, 0, Activity.Width, Activity.Height)

For the line: ListView1.ScrollingBackgroundColor = Colors.Black

I have tried everything with Colors.Transparent and even Colors.ARGB(255,0,0,0)
 
Upvote 0

kickaha

Well-Known Member
Licensed User
Longtime User
Add a full size panel to the Activity, with its color set to black

B4X:
   lvpan.Initialize ("")
   lvpan.Color = Colors.BlackActivity.AddView (lvpan, 0, 0,    Activity.Width, Activity.Height)
Add your listview to the panel
B4X:
   lvpan.AddView(ListView1, 0, 0, Activity.Width, Activity.Height)
You can the hide/show the panel to get the listview
 
Upvote 0

Omar

Member
Licensed User
Longtime User
Wow ... I just can't believe that :BangHead:

I was assuming all along that the default value is Black.

Thanks alot for your help.
 
Upvote 0

Omar

Member
Licensed User
Longtime User
Add a full size panel to the Activity, with its color set to black

B4X:
   lvpan.Initialize ("")
   lvpan.Color = Colors.BlackActivity.AddView (lvpan, 0, 0,    Activity.Width, Activity.Height)
Add your listview to the panel
B4X:
   lvpan.AddView(ListView1, 0, 0, Activity.Width, Activity.Height)
You can the hide/show the panel to get the listview


Thank you kickaha.

Appreciate your suggestion also and actually I was just thinking of going this route as well but Erel's suggestion did the trick.
 
Upvote 0
Top