0

So I have a layout thats fairly complex and has some layout nesting . The layout holds 8 items, but if my api response returns say 32 items id like to loop the same xml layout over and over and make it scrollable. Would this be possible? I considered a custom listview, but im not sure if this is to complex for that.

ChuckKelly
  • 1,742
  • 5
  • 25
  • 54

1 Answers1

0

This is certainly possible. I would use a ListView with a custom adapter. You can put fairly complex views as rows in there, plus you get all the performance benefits of a ListView.

Otherwise you could do it all programmatically quite easily.

Pseudocode:

for (Item item : yourResponseItems) {
    View view = (infate/build your view)
    // Do stuff here 
    RootView.addView(view);
}
Ken Wolf
  • 23,133
  • 6
  • 63
  • 84