Try making the default item the last one in the list...  seems weird, I
know, but I have always run into unexpected behavior if the default item is
not last.

----------------------------------------------------------------------
There are only 10 types of people in the world...
Those who know binary and those who don't.
----------------------------------------------------------------------


On Thu, Nov 19, 2009 at 4:48 AM, Jags <[email protected]> wrote:

> <?xml version="1.0" encoding="utf-8"?>
> <selector xmlns:android="http://schemas.android.com/apk/res/android";>
>        <item android:drawable="@drawable/image1" /> <!-- default -->
>        <item android:state_pressed="true" android:drawable="@drawable/
> image2" /> <!-- pressed -->
>        <item android:state_focused="true" android:drawable="@drawable/
> image3" /> <!-- focused -->
> </selector>
>
> i wrote this in btnattr.xml file in drawale.
>
> and in my main.xml i wrote
> <ImageButton android:id="@+id/ImageButton09"
>                        android:layout_width="80px"
> android:layout_height="80px"
> android:src="@drawable/btnattr"
>                        android:scaleType="fitXY"
> android:layout_marginLeft="20dip"
>                        android:layout_marginTop="20dip"
> android:background="@android:color/
> transparent"></ImageButton>
>
>
> when the application is run, the image1 is displayed, expected.
>
> but when i press the button image2 is not displayed ! where am I going
> wrong ?
>
> Thanks for helping
>
> regards
> Jagat
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Beginners" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<android-beginners%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/android-beginners?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" 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-beginners?hl=en

Reply via email to