hi,
I have a button that shows exactly as it should, until I have clicked
it, then it doesn's show it's background any more. The funny thing is
that all other buttons of the same style loose their backgrounds as
well. Sometimes the opposite happens: all backgrounds in my app get
the button background.

The style that defines the button is

        <style name="image_button">
                <item name="android:layout_width">wrap_content</item>
                <item name="android:layout_height">wrap_content</item>
                <item name="android:textColor">@color/button_text</item>
                <item name="android:textSize">16sp</item>
                <item name="android:paddingLeft">10dip</item>
                <item name="android:paddingRight">10dip</item>
                <item name="android:paddingTop">3dip</item>
                <item name="android:paddingBottom">3dip</item>
                <item name="android:gravity">center_vertical</item>
                <item name="android:background">@drawable/mybutton</item>
        </style>

The statelist "mybutton" is

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android";>
    <item android:state_enabled="false"
          android:drawable="@drawable/btn_disabled" />
    <item android:state_enabled="true"
          android:state_pressed="true"
          android:drawable="@drawable/btn_pressed" />
    <item android:state_enabled="true"
          android:state_focused="true"
          android:state_pressed="false"
          android:drawable="@drawable/btn_selected" />
    <item android:state_enabled="true"
          android:state_focused="false"
          android:state_pressed="false"
          android:drawable="@drawable/btn_button" />
</selector>

I have tried extending the Button class and set the backgroundDrawable
from there, to no avail. How can my button make other similar buttons
in different activities disappear? How can my button background show
up in activities that don't have any buttons?

Help is appreciated :-)

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