Skip to content Skip to sidebar Skip to footer

Android Custom Layout Listview With Images

I would like to manage to obtain a listview with dynamic items. I built a row_layout containing an ImageView, and 2 TextViews. When I build the adapter, I want to be able to displa

Solution 1:

Where can I assign my pictures to my ImageView?

Do this in the getView() method of your Adapter. It looks like you are doing that now.

And How can I make the ImageView "disappear" for certain rows?

Use anif statement and if it isn't the correct row (position) call

holder.hldIcon.setVisibility(View.INVISIBLE)`

or

holder.hldIcon.setVisibility(View.GONE)

depending on what you want

Post a Comment for "Android Custom Layout Listview With Images"