I am creating a custom button style and applying it to all buttons in my theme, but the buttons don't seem to react to the part of the style that says to change their margins.
(Here's the tutorial I followed to learn this: http://www.androidcookbook.com/Recipe.seam?recipeId=3307)
Here's the shape I'm using for the button (not sure if it matters to you?):
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid
android:color="#2AB571" />
<padding android:left="7dp"
android:top="7dp"
android:right="7dp"
android:bottom="7dp" />
<corners android:bottomRightRadius="25dp" />
<corners android:topLeftRadius="25dp" />
</shape>
And here's the style buttonStyle I've created (with the margin set at the bottom):
<style name="button" parent="@android:style/Widget.Button">
<item name="android:gravity">center_vertical|center_horizontal</item>
<item name="android:textColor">#FFFFFF</item>
<item name="android:shadowColor">#FF0000</item>
<item name="android:shadowDx">0</item>
<item name="android:shadowDy">-1</item>
<item name="android:shadowRadius">0.2</item>
<item name="android:background">@drawable/button</item>
<item name="android:minHeight">48dip</item>
<item name="android:minWidth">88dip</item>
<item name="android:layout_margin">50dp</item>
</style>
Then here is where I'm applying the buttonStyle to my theme:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="GreenBlueTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:buttonStyle">@style/button</item>
</style>
</resources>
Then here is an image of what it looks like:
Why no margin of 50dp?
Thanks for your help, Rune.