Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I suppose you are using the above XML to populate the items in the list view (i.e) inside getView() ... <br> <br> 1. Remove <code>android:background="@drawable/ac"</code> from the above XML.<br> 2. Add it to the ListView's XML say,<br></p> <pre><code>&lt;ListView android:id="@+id/listView" android:background="@drawable/ac" android:layout_width="fill_parent" android:layout_height="wrap_content" /&gt; </code></pre> <p><strong>Explanation:</strong></p> <p>Setting Background to the layout that you are using to populate the list will produce <em>'repeating image'</em> because you are setting background to the child (i.e) the listView's item and not to the List.</p> <p><strong>EDIT:</strong><br> 1.For your Activity, you will be loading the ListView from an Layout File(say main.xml), inside that layout file for the ListView add the background. <br> <br> 2. Remove the background from the LinearLayout in your above code. <br></p> <p><strong>Edit Again:</strong></p> <p><br> use the following XML, <br> <strong>main.xml</strong></p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/ac" &gt; &lt;TextView android:layout_width="fill_parent" android:layout_height="wrap_content"/&gt; &lt;ListView android:id="@+id/listView" android:background="#00000000" android:layout_width="fill_parent" android:layout_height="wrap_content" /&gt; &lt;/LinearLayout&gt; </code></pre> <p><br></p> <p><strong>List xml file</strong></p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:cacheColorHint="#00000000" android:background="#00000000" &gt; &lt;TextView android:id="@+id/item_title" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textAppearance="?android:attr/textAppearanceMedium" android:padding="2dp" android:textSize="20dp" /&gt; &lt;TextView android:id="@+id/item_subtitle" android:layout_width="fill_parent" android:layout_height="wrap_content" android:padding="2dp" android:textSize="18dp" /&gt; &lt;/LinearLayout&gt; </code></pre>
    singulars
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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