Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You would have to create a custom list adapter and override its getView() function. Then create a layout of your custom listview item that includes a textview and an imageview. Then you can initialize the textview and imageview in the getView() function of your custom list adapter and change the value of the textview and the image of the imageview however you want.</p> <p><strong>GetView() function:</strong></p> <pre><code>public View getView(int position, View convertView, ViewGroup viewGroup) { TextView tv = (TextView)convertView.findViewById(R.id.tvChild); tv.setText("example text"); ImageView image = (ImageView)convertView.findViewById(R.id.image); // You can choose to use either of the below functions to set the image image.setImageBitmap(null); image.setImageDrawable(null); image.setImageResource(Position); } </code></pre> <p><strong>Custom listview Item layout:</strong></p> <pre><code>&lt;LinearLayout android:id="@+id/LinearLayout01" android:layout_width="fill_parent" android:layout_height="wrap_content" xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal"&gt; &lt;ImageView android:id="@+id/image" android:layout_height="wrap_content" android:layout_width="wrap_content" android:gravity="center_vertical"&gt; &lt;/ImageView&gt; &lt;TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center_vertical" android:id="@+id/tvChild" android:layout_marginLeft="6dip" &lt;/LinearLayout&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload