Create frame for item list

0

I need to create a frame for an item in a listView but I have no idea how to do this

    
asked by anonymous 25.04.2018 / 05:38

2 answers

1

It is now recommended to use the RecyclerView or CardView instead of ListView , but if you still need to make use of ListView which in this case will have custom layout, see the Android documentation on Adapter for ListView . One possibility would be to extend BaseAdapter .

Basically, you would use View where your list will get a conventional ListView and would create an adapter in Java with the specifics of your ListView including the layout and methods of what should happen when you press an item in the list or press for a longer time.

In the ListView related activity, create an adapter object and use the setAdapter (ListAdapter l) method to link your custom adapter to ListView .

You can check out here for an example.

    
25.04.2018 / 14:34
0

If you want to customize the ListView, I recommend this tutorial there:

link

They explain everything right! I hope I have helped!

    
25.04.2018 / 16:06