user2786
user2786

Reputation: 716

Best way to create custom list layout in Android

i am new to Android. I need to create a layout having list views along with textview and image icons. Please refer the attached screenshot and give me suggestion that how can i achieve this?

enter image description here

Thanks!

Upvotes: 0

Views: 7029

Answers (2)

Yasmine GreenApple
Yasmine GreenApple

Reputation: 448

To create a custom list view you need to follow some simple steps :

  1. create the xml layout of one row of your list_view and the xml layout for the main activity including in it the listView control
  2. create a custom adapter for the custom listview that allows you to get the texts and images in your custom ListView and change them
  3. attach your data (as an arraylist) to the listView

I won't give you the code in this post, instead I will give you a very detailed tutorial that for me is the most straightforward to create what you want to achieve : Create custom listview tutorial

Upvotes: 2

sjain
sjain

Reputation: 23344

An excellent tutorial to do just like that -

Implement the customListView using BaseAdapter. In CustomListView show the ImageViewwith TextView for each list item.

Check ==> custom-listview-with-imageview-and-textview-in-android.

The display -

enter image description here

Upvotes: 0

Related Questions