Why did you use complex item layout?

Use selector as TableLayout background.



On 20 Лис, 21:18, Francesco <nolano...@gmail.com> wrote:
> Hi all.
>
> i have a list View in my app (this is the xml layout):
>
> <?xml version="1.0" encoding="utf-8"?>
> <ListView xmlns:android="http://schemas.android.com/apk/res/android";
>         android:id="@+id/arrayList"
>         android:layout_width="fill_parent"
> android:layout_height="fill_parent"
>         android:textFilterEnabled="true"
>         android:scrollbars="vertical"
>         android:drawSelectorOnTop="true">
> </ListView>
>
> Each item of my list View is composed of two TextView:
>
> <?xml version="1.0" encoding="utf-8"?>
> <TableLayout android:layout_width="fill_parent"
>         xmlns:android="http://schemas.android.com/apk/res/android";
> android:id="@+id/row_container"
>         android:padding="5px" android:layout_height="wrap_content"
>         android:background="@color/white" android:shrinkColumns="0">
>                 <TableRow>
>                 <TextView android:layout_height="wrap_content"
>                         android:layout_width="wrap_content" 
> android:layout_below="@+id/
> description"
>                         android:id="@+id/description"
>                         android:textColor="@color/black"
>                         android:scrollHorizontally="true"
>                         android:singleLine="true"></TextView>
>         </TableRow>
>         <TableRow>
>                 <TextView android:layout_width="wrap_content"
>                         android:layout_height="wrap_content" 
> android:id="@+id/result"
>                         android:textColor="@color/grey"
>                         android:maxLines="1"
>                         android:scrollHorizontally="true"></TextView>
>         </TableRow>
>
> </TableLayout>
>
> I would like to change background color (and text color) of each item
> of my ListView on focus (and, if possibile on selection). How can i do
> it?
>
> Thanks to all
> francesco

-- 
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