1

I need to set a background color and icon image for each item/row in the list view. ArrayAdapter set a single layout to all the items to be added to the list and I tried to catch every item getChildAt() but it fails !!

simply, I need to build a listview like that :

Example

BTW, It will be used inside the navigation drawer, as shown :

enter image description here

2 Answers 2

1

You need to use "BaseAdapter" for this task, check the link blow, and customize the example according to your need.

http://www.androidhive.info/2012/02/android-custom-listview-with-image-and-text/

you can also check this

http://www.vogella.com/articles/AndroidListView/article.html

Sign up to request clarification or add additional context in comments.

Comments

0

You'll need to define your own custom adapter (look here for info on that) and then you'll be able to do custom layouts for individual list view items

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.