You must override the background image 9 patch.  Look in <android_sdk>
\tools\lib\res\default\drawable for the default 9 patches.  For
example, a selected list item has the background
list_selector_background_focus.9.png

Once you have made your images, you must creator xml in your drawable
folder for the selector, which points to the different files for
different states of the widget.  Then for your view, you set the
background as that selector's xml.

In short:

In your layout, your ListView's background = drawable/my_listview.xml
which contains a <selector> that points to your custom 9 patch files
that correspond to the different states.

On May 23, 6:37 am, manoj <[email protected]> wrote:
> Hi,
>
> 1. I want to use my own color for selecting ui views.
>
> By default, android shows the selected view with background as orange.
> I want to show the view background color as red.
>
> 2. In the same way, I want the same behaviour should be applied to
> whole application.
>
> How can I achieve this?
>
> Can any one please help me?
>
> Thanks,
> Manoj.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to