Wie platziere ich Buttons über Image in Android?
Ich möchte eine benutzerdefinierte Ansicht wie diese erstellen.
Ich habe folgendes versucht
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical" >
<ImageView
android:id="@+id/customView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/sample_image" />
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right|top"
android:text="Button" />
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right|bottom"
android:text="Button" />
</FrameLayout>
Wie kann ich eine Ansicht wie diese erstellen? Wie kann ich Schaltflächen so über der Bildansicht platzieren?
Danke im Voraus