Android button margins when background color added



I have problem with button margins (Android Studio) when I change background colors of buttons. All buttons are the same size but those added background color has no space between them. How can I fix this?


No spaces between buttons with added background color


This code is for buttons for uncolored buttons



<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/btnAdd"
android:id="@+id/btnAdd"
android:layout_above="@+id/btnSub"
android:layout_centerHorizontal="true"/>


And I added this line for get background color on colored buttons.



android:background="@color/red"


If I delete all background attributes from middle buttons then all buttons looks same same and in sync.


No comments:

Post a Comment