List View In Libgdx

Viewed 3550

I have arraylist of powerUps and I want to display as a List view and whichever row user selects get that particular power for specific time. All thing is done except I am not able to display arraylist items on listview in libgdx. I searched a lot but didnt get any idea. I want something like this.

enter image description here

3 Answers

Use ScrollPane

The tutorialsface implemented a sample...

ScrollPane scrollPane = new ScrollPane(get_long_actor___like_List());

and sample of the get_long_actor___like_List() :

private Actor get_long_actor___like_List() {
        Table table = new Table();
        //--------------------------------
        for (int i = 0; i < 30; i++)
        {
            table.row().center().padTop(10);
            table.add(new Label("Sample Item")).size(WIDTH, 50);
        }
        //--------------------------------
        return table;
}
Related