This was a little confusing to me at first so I hope this code extract
will help you out:

Java:
----------------------

public View getView(int position, View convertView, ViewGroup parent)
{

      // Inflate row layout from 'list_row.xml'
      View row = inflater.inflate(R.layout.list_row, null);

        // Set Photo
        ImageView photo = (ImageView) row.findViewById(R.id.photo);
        photo.setImageBitmap(photoFromResources);
        // Set  Name
        TextView name = (TextView) row.findViewById(R.id.name);
        name.setText("Name to appear");

        return (row);
}



XML 'list_row.xml'
---------------------------------

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/
android"
        android:layout_width="fill_parent" android:layout_height="64px">

        <ImageView android:id="@+id/photo"
                android:layout_width="64px" android:layout_height="64px"
                android:layout_x="0px" android:layout_y="0px"/>

        <TextView android:id="@+id/name" android:layout_width="wrap_content"
                android:layout_height="wrap_content" android:paddingLeft="8px"
                android:paddingTop="5px" />

</RelativeLayout>

Hope that helps!




On Feb 6, 10:34 am, munish <munish.sha...@lntinfotech.com> wrote:
> hey thanx
> Marco.........
>
> On Feb 6, 3:16 pm, Marco Schmitz <netzprofi.ma...@googlemail.com>
> wrote:
>
> > you need to create an xml for each children row. please take a look at
> > the 14 list source codes inside your api samples.
>
> > greetings,
> > darolla
>
> > 2009/2/6 munish <munish.sha...@lntinfotech.com>:
>
> > > Can any one please tell me how to add multiple items (images/text) in
> > > list view- Hide quoted text -
>
> > - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to