thanks Dan i have done it like this

mText.setTextColor(new ColorStateList(
                new int[][] {
                        new int[] { android.R.attr.state_selected},
                        new int[1],
                    }, new int[]
{
                        Color.rgb(255, 255, 255),
                        Color.BLACK,

                    }
         ));


but there is a problem i want to show a white background border on
selecting a listview item ..how can i do this ??

On Apr 7, 11:36 am, "Dan U." <[EMAIL PROTECTED]> wrote:
> For your first question, I think you can just create a layout with
> whatever views you need for a list item (perhaps just a single
> textview) and then add padding to that. Here's an example:
>
> <?xml version="1.0" encoding="utf-8"?>
> <TextView xmlns:android="http://schemas.android.com/apk/res/android";
>         android:id="@android:id/text" android:layout_width="fill_parent"
>         android:layout_height="wrap_content" android:paddingBottom="20sp">
> </TextView>
>
> Then just reference that as a the list item to use when you set the
> list adapter.
>
> As for the second question, there might be a way to do this with
> styles, but I don't know right now. You could programmatically do it
> by setting an OnItemClickListener for the list and then just make a
> setTextColor call on the TextView. Probably in your instance, the View
> that gets passed into onItemClick is the TextView.
>
> On Apr 6, 10:43 pm, Greg <[EMAIL PROTECTED]> wrote:
>
> > Hello Android Champs
>
> > 1 what i want is i want to give a margin or distance between the
> > listview items
>
> > Like
>
> > A
> > B
>
> > A
>
> > B
>
> > 2 secondly i want to show the white textcolor on selection of an item
> > of listview ..
>
> > i have successfully changed the background color but unable to change
> > the textcolor please help me out
>
> > Waiting for your reply guys....
--~--~---------~--~----~------------~-------~--~----~
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
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to