ScrollView double layer problem

joneden

Active Member
Licensed User
Longtime User
Hi All,

I just noticed something weird.

I have setup a scrollview and inside have panels for each record. I left a 5dip spacer between each. When loading the app and scrolling the view upwards, I noticed that it seems that two layers have been drawn, the top layer scrolls while the mirror image bottom layers stays put. It's really odd. The only fudge that I can think of to solve it is to draw the spacer as a panel but that's a bit of a rubbish solution.

Is this something that is well known that I've missed or do I need to start investigating more.

Best Regards,

Jon
 

klaus

Expert
Licensed User
Longtime User
Where and how do you populate the ScrollView.Panel.
Without seeing your code it's difficult to give you a concrete answer.
Put a Log(ScrollView.Panel.NumberOfViews) at the end where you populate the ScrollView.Panel to see if the number does increase.
If yes then you need to remove all views from ScrollView.Panel before populating it again.
There is no need to put an extra Panel for the separation the ScrollView.Panel background color is enough.

Best regards.
 
Upvote 0

Informatix

Expert
Licensed User
Longtime User
There is no need to put an extra Panel for the separation the ScrollView.Panel background color is enough.
If you use the background color, that means your divider and all items are opaque. You cannot have transparent items with an opaque divider. That's why I add colored panels as dividers. That has almost no impact on performance or memory. I place them at the bottom of the item panel. They are not separate and thus do not change the item count.
You can also use a 9-patch image as background. You draw the divider line at its bottom.
 
Upvote 0

joneden

Active Member
Licensed User
Longtime User
Thanks for the comments, I'll look into this some more this afternoon once I've got my login page working.

App is growing rather fast now!

Once fixed I'll post what the problem is in case anyone else stumbles over the same issue.

Regards,

Jon
 
Upvote 0
Top