Skip to content Skip to sidebar Skip to footer

Android Theme Style For Button Not Applying

I have three simple buttons in my main activity view. What I am trying to do is apply a buttonstyle to all my buttons but I fail to do so. Here's my xml:

Solution 1:

When using the support library the button style must be applied as:

<!-- Application theme. --><stylename="AppTheme"parent="AppBaseTheme"><itemname="android:buttonStyle">@style/ButtonTheme</item><itemname="buttonStyle">@style/ButtonTheme</item></style>

Note the duplication but with no namespace

Solution 2:

The code that you post is working. Please add style on button in xml, to see if that is working for you.

<Button
    style="@style/ButtonTheme"

    android:id="@+id/btnCrafting"
    android:layout_width="200dp"
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true"
    android:layout_centerVertical="true"
    android:background="@drawable/button_selector"
    android:onClick="craftingButtonClicked"
    android:text="@string/crafting" />

Solution 3:

Try running "clean" on the project when changing styles or the manifest file.

Post a Comment for "Android Theme Style For Button Not Applying"