• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps ListAdapter repeating other items

richymtfc

Lurker
Using Eclipse, Android 2.2, I have the following layout:

Code:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" 
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:background="@color/BackgroundColour"
    android:id="@+id/reg_ScrollView">
        
    <LinearLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="vertical"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:id="@+id/reg_LinearLayout">
      
          <ImageView 
                android:src="@drawable/logo" 
                android:id="@+id/imageView1" />
                            
        <LinearLayout
              xmlns:android="http://schemas.android.com/apk/res/android"
            android:orientation="vertical"
              android:layout_width="match_parent"
              android:layout_height="match_parent">
            <TextView 
                android:text="@+id/TextView01" 
                android:id="@+id/label"
                android:textSize="30px" />
        </LinearLayout>
    </LinearLayout>    
</ScrollView>
with the below code:
Code:
this.setListAdapter(new ArrayAdapter<String>(this, R.layout.listitems, R.id.label, arrSubNames));
Previously, before I put in the logo, the list adapter was doing as expected, with a list of values from the arrSubNames array.

However, now it is doing the list, but also repeating the logo as well in each list item. Why is this the case, when the ArrayAdapter specifically mentions to put everything into R.id.label label to be populated?

I've tried wrapping another LinearLayout around the logo, but still the same happens.


Thanks.
 
Back
Top Bottom