0

The following style is used by buttons:

<style name="AppThemeStyle" parent="Theme.MaterialComponents">
    <item name="windowActionBar">false</item>
    <item name="windowNoTitle">true</item>
    <item name="colorPrimary">@color/black</item>
    <item name="colorOnPrimary">@color/white</item>
    <item name="materialButtonStyle">@style/MaterialButton</item>
</style>

<style name="MaterialButton" parent="Widget.MaterialComponents.Button">
    <item name="backgroundTint">#222</item>
    <item name="android:layout_margin">8dp</item>
</style>

I know buttons are using this style because their color (backgroundTint) is what specified. However, android:layout_margin seems to have no effect on margins. According to this article, Button is mapped to MaterialButton. I thought modifying materialButtonStyle would affect every Button. Could anyone offer a tip on how to style margins of material buttons?

Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841
Hong
  • 17,643
  • 21
  • 81
  • 142

0 Answers0