Android Question Many CustomListView in a activity

Christian García S.

Active Member
Licensed User
Hello, can someone help me ?

I'm making an application with dynamic information, and well I have a custom list view (CLV) to upload some images of promotions, but then I need to load another horizontal CLV of product categories following the previous one, and after these two I need to load another CLV with some products vertically.

For example, if I have the first CLV with 4 cards, I need them to occupy the entire screen and when the user scrolls, finish and start the next horizontal CLV and then a vertical CLV again.

I attached an example of a samsung application to understand a little better, the example has horizontal and vertical CLV one after another.

Can you guide me how to do it ???

Thanks.
 

Attachments

  • imagen.jpeg
    imagen.jpeg
    91.8 KB · Views: 319

Christian García S.

Active Member
Licensed User
Hello @Erel, thanks for your response.

CLV1 anchor is horizontal = both, vertical = both
CLV2 anchor is horizontal = both, vertical = top

When I use anchors, CLV 2 is on top and in the middle of CLV 1 (image1) and CLV1 does not take the total of the screen as you can see it has that gray part.

When I use a script in the designer with this code:

B4X:
clvcards.SetTopAndBottom (ToolBar.Height + pnlUser.Height + 2.93% y)
clvcategories.SetTopAndBottom (clvcards.Height, 93%y)

You can see CLV1 and CLV2 fixed, behind CLV2 moves CLV1, but the intention is that at the end of CLV1 with its many cards it shows CLV2. (image2)

do we need nested CLVs ??, the first CLV contains panels and within those panels other CLVs.


Thank you.
 

Attachments

  • imagen1.jpeg
    imagen1.jpeg
    52.6 KB · Views: 289
  • imagen2.jpeg
    imagen2.jpeg
    73.6 KB · Views: 303
Last edited:
Upvote 0

icarus

New Member
Licensed User
you may try this:
CLV1 (Horizontal): ancor horizontal = Both, vertical = Top
CLV2 (Vertical): ancor horizontal = Both, vertical = Both

hope that helps..
 

Attachments

  • Screenshot_1539213855.png
    Screenshot_1539213855.png
    43.3 KB · Views: 276
Upvote 0
Top