Saturday, July 24, 2010

[android-developers] Re: How do I set the selected state of an item in a gallery (the correct way)

Try moving your state_selected statement above your state_pressed item
and see if it works.

On Jul 24, 6:07 pm, Mark Nuetzmann <mark.nuetzm...@gmail.com> wrote:
> I have a gallery that displays TextViews where the background of each
> view is the following:
>
> <?xml version="1.0" encoding="utf-8"?>
> <selector xmlns:android="http://schemas.android.com/apk/res/android">
>     <item
>         android:state_pressed="true"
>         android:drawable="@drawable/item_pressed" />
>     <item
>         android:state_selected="true"
>         android:drawable="@drawable/item_selected" />
>     <item
>         android:drawable="@drawable/item_idle" />
> </selector>
>
> This selector work just fine for the state_pressed and default (idle)
> states, but the selected item state is never displayed.  I REALLY do
> not want to force the background of the selected item by changing the
> background of the view when the onItemSelected event is called.  What
> is the correct state or correct way to get the TextView background to
> be set properly.  Is the selected (center) view in the gallery not
> really selected?  Is there some other state I should put in the
> selector drawable xml?
>
> Thanks, Mark.

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate