Answer the question
In order to leave comments, you need to log in
How to remove padding between buttons in android?
Several buttons are sequentially inserted into a LinearLayout. I set the parameter: android:layout_margin="0dp"
But some minimum indent between the buttons still remains. And I want to make the buttons stick together. If you use an ImageButton, then the padding disappears completely, but this does not happen with the Button.
<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_below="@+id/linearLayout"
android:layout_margin="0dp">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="25"
android:id="@+id/button7"
android:layout_margin="0dp" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="35"
android:id="@+id/button6"
android:layout_margin="0dp" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="50"
android:id="@+id/button8"
android:layout_margin="0dp" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="80"
android:id="@+id/button9"
android:layout_margin="0dp" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="100"
android:id="@+id/button10"
android:layout_margin="0dp" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="П1"
android:id="@+id/button11"
android:layout_margin="0dp" />
</LinearLayout>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question