Ivan Soto wrote:
> This is what I'm trying to achieve: Have a list and in each list item
> have multiples elements.
> 
> Have a list that
> 
> file_row.xml is working if I do this:
>     <TextView android:id="@+id/text2"
> xmlns:android="http://schemas.android.com/apk/res/android";
>         android:textAppearance="?android:attr/textAppearanceSmall"
>         android:layout_width="fill_parent"
>         android:layout_height="fill_parent"
>         android:text="TCaptionsmall"/>
> 
> I want it to be
> <?xml version="1.0" encoding="utf-8"?>
> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android";
>     android:layout_width="wrap_content"
>     android:layout_height="wrap_content">
>     <TextView android:id="@+id/text1"
>         android:textAppearance="?android:attr/textAppearanceLarge"
>         android:layout_width="fill_parent"
>         android:layout_height="fill_parent"
>         android:layout_marginTop="8dip"
>         android:layout_marginBottom="8dip"
>         android:text="TCaption biig"/>
>     <TextView android:id="@+id/text2"
>         android:textAppearance="?android:attr/textAppearanceSmall"
>         android:layout_width="fill_parent"
>         android:layout_height="fill_parent"
>         android:text="TCaptionsmall"/>
> </LinearLayout>

If you're using SimpleCursorAdapter, just provide both column IDs and
both TextView IDs to the adapter constructor.

If you're using something else, you will probably need to override
getView() in the adapter to inflate the XML yourself. See my Fancy
ListView series on AndroidGuys for details:

http://androidguys.com/?s=fancy+listviews

(forgive the formatting, and forgive that these examples were mostly for
the older M5 SDK and may need some tweaks to work on the current SDK)

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 2.0 Published!

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to