Iterating the views of a ListView

  • Replies:0
  • OpenNot stickiedUnanswered
  • Forum posts: 8

Mar 10, 2019, 6:56:22 PM via Website

I have a ListView to which I have bound an array adapter.

android:id="@+id/Listview"
android:layout_height="wrap_content"
android:scrollbars="horizontal"
android:drawSelectorOnTop="true"
android:textFontWeight="10"
android:fontFamily="Footlight MT"
android:background="@drawable/bg_key"
android:layout_width="match_parent">

    ArrayAdapter<String> arrayAdapter;

ListView lview = null;
lview = (ListView) findViewById(R.id.Listview);
arrayAdapter = new ArrayAdapter(this, android.R.layout.simple_list_item_1, todo_list);
lview.setAdapter(arrayAdapter);

The listview displays a single column of values. I need to set each row of the ListView a different color. I tried a number of links. I think I need to get each view of the Listview and set the color. Can someone please tell me how I can do this?

Be the first to answer
Recommended articles