Where does the extra space around my button come from?

I have a simple layout:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:orientation="vertical"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent">
    <LinearLayout android:orientation="horizontal"
                  android:layout_width="fill_parent"
                  android:layout_height="wrap_content"
                  android:padding="5dp"
                  android:id="@+id/acquiring_signal_layout">
        <ProgressBar android:id="@+id/ProgressBar01"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"/>
        <TextView android:id="@+id/acquiring_signal_label"
                  android:text="@string/acquiring_signal"
                  android:layout_width="fill_parent"
                  android:textAppearance="?android:attr/textAppearanceLarge"
                  android:layout_height="wrap_content"
                  android:layout_gravity="center_vertical"
                  android:paddingLeft="5dp"/>
    </LinearLayout>
    <com.google.android.maps.MapView
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/mapview"
        android:clickable="true"
        android:layout_height="wrap_content"
        android:layout_width="fill_parent"
        android:apiKey="..."
        android:layout_weight="1"/>
    <Button
        android:text="@string/send_button"
        android:id="@+id/SendButton"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content">
    </Button>
</LinearLayout>

It works fine, except when it is displayed, the button at the bottom has a few (about 5, I think) pixels of the black field / space around it. Button field setting does not seem to be affected. What's happening?

+5
source share
2 answers

This is from the drawings that are used for the button background. There are a couple of pixels that are transparent in the button. if you set your own for yourself, you will notice that there is no "empty space".

+6
source

Have you tried setting a negative margin for the button?

0
source

All Articles