Ich habe ein einfaches Layout:Woher kommt der zusätzliche Platz um meinen Knopf?
<?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>
Es funktioniert gut, außer wenn es macht, erscheint die Schaltfläche am unteren Rande mehr zu haben (etwa 5, ich denke, würde) Pixel von schwarzen Rand/Raum um ihn herum . Die Einstellung des Randes der Schaltfläche scheint keine Auswirkungen zu haben. Was ist los?
In der Dokumentation zeichnen die Attribute {Links, Rechts, usw.}, die gezeichnet werden können, Elemente * innerhalb * der Schaltfläche, nicht in deren Peripherie. Zum Beispiel könnte ein Symbol innerhalb der Schaltfläche mit DrawableLeft angezeigt werden. Ich spreche über den schwarzen Raum * außerhalb * des Widgets, wird aber immer noch mit dem Button gerendert. –
Ja, das verwendete Bild hat einen transparenten Bereich auf der Außenseite. Dies ist immer noch Teil des "Knopfes", obwohl Sie es nicht sehen können. Versuchen Sie, Android: Hintergrund = "# FFFF0000" und Sie werden sehen, was ich meine. –