I'm trying to style all my buttons, however for some reason my style is not affecting their margins. (they appear right next to each other) Changing the layout_margin right on the layout.xml however does work.
This is my code:
<style name="Button" parent="@android:style/Widget.DeviceDefault.Button">
<item name="android:layout_margin">5dp</item>
<item name="android:background">@android:color/holo_orange_light</item>
</style>
This is my layout:
<TableRow
android:layout_weight="1"
android:orientation="horizontal"
android:baselineAligned="false"
android:clickable="false"
android:layout_height="fill_parent"
android:layout_width="match_parent">
<Button
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:text="1"
android:id="@+id/button1"
android:layout_weight="0.06"
android:clickable="true" />
<Button
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:text="2"
android:id="@+id/button2"
android:layout_weight="0.06" />
<Button
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:text="3"
android:id="@+id/button3"
android:layout_weight="0.06"
android:layout_marginBottom="2dp" // This works
android:layout_marginTop="2dp" />
</TableRow>
//...
What am I doing wrong?