Create frame for item list

Asked

Viewed 78 times

0

I need to create a frame for a listview item but I have no idea how to do this inserir a descrição da imagem aqui

2 answers

1


Today it is recommended the use of Recyclerview or Cardview in place of Listview, but if still, if you need to make use of the Listview which in case will have customized layout, see the Android documentation on Adapter for Listview. One possibility would be to extend Basedapter.

Basically, you would use View where your list will be Listview and create an adapter in Java with the specifics of your Listview, including the layout and methods of what should occur when pressing a list item or pressing for a longer time.

Already in the activity related to Listview, create an Adapter object and make use of the method setAdapter(Listidapter l) to link your custom adapter to Listview.

You can check out here an example.

0

Browser other questions tagged

You are not signed in. Login or sign up in order to post.