Android Question Strange bars in customlistview?

Yuri Cinesi

Active Member
Licensed User
I'm using a textbox to have the user input a search criteria. The app then searches a file and populates the listview with all the items it found matching that criteria. For some reason any item that is more than two lines displays the black bars shown in the screenshot.

The color of those black bars is determined by listview.sv.color, but I can't simply change its value since it determines the divider.

This is not xCustomListView as I'm using an older version of B4A (7.01) and when I tried to use it if I recall correctly it required some features not present in this version.

How can I fix this? I've been completely unable to replicate this behaviour in a smaller project, no matter how similar I make the conditions. It also seems to happen randomly sometimes with some listviews I have separated using TabStripViewPager, within the same app.
 

Attachments

  • Screenshot_2018-05-30-08-38-40[1].png
    Screenshot_2018-05-30-08-38-40[1].png
    193.8 KB · Views: 150
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime User
This is not xCustomListView as I'm using an older version of B4A (7.01) and when I tried to use it if I recall correctly it required some features not present in this version.
xCustomListView is the way to go. It is more powerful than the older CustomListView class.

How are you adding items?
 
Upvote 0

Yuri Cinesi

Active Member
Licensed User
I'm using .addTextItem. I'd actually prefer to stick with the current CustomListView as I edited it a bit, but if necessary I can try switching.

For reference, I added lazy loading at around 75% of the total height of the view. This doesn't apply for this specific customlistview however.
 
Last edited:
Upvote 0

Yuri Cinesi

Active Member
Licensed User
I'm trying to switch, but it throws the following warning: Cannot access view's dimension before it is added to its parent.

If I edit those lines it keeps crashing in different points throwing errors about nullpointerexceptions. The same happens with the example linked in the post about xcustomlistview.
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
Sarai pure Yuri Cinesi ma mi sembri tanto italiano, vista l'app :)

I'm trying to switch, but it throws the following warning: Cannot access view's dimension before it is added to its parent.

If I edit those lines it keeps crashing in different points throwing errors about nullpointerexceptions. The same happens with the example linked in the post about xcustomlistview.
We don't know how you are using CLV (probably not in the right way ;)) and we don't know "those lines". However, in some cases, you could/should call routines using CallSubDelayed from Activity_Create, so that the UI is completely created.
 
Upvote 0

Yuri Cinesi

Active Member
Licensed User
We don't know how you are using CLV (probably not in the right way ;)) and we don't know "those lines". However, in some cases, you could/should call routines using CallSubDelayed from Activity_Create, so that the UI is completely created.

As I wrote above the example downloaded from the xcustomlistview post also crashes as well, which makes me think it's something to do with my version of B4A rather than how I'm using CLV.

The lines that error out are line 58,445 and 446 within the customlistview.bas file. I'm using the file as is, without editing anything. I've attached a couple screenshots.
 

Attachments

  • Screenshot1.png
    Screenshot1.png
    83.1 KB · Views: 189
  • Screenshot2.png
    Screenshot2.png
    73.9 KB · Views: 153
Last edited:
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
As I wrote above the example downloaded from the xcustomlistview post also crashes as well, which makes me think it's something to do with my version of B4A rather than how I'm using CLV.
In older versions of B4A, it was not possible to set the size of a view without adding it to a parent. This is now possible and is very useful. This is the cause of the error.
 
Upvote 0
Top