Android Floating View (über andere Views)
Ich habe jetzt ein paar Tage damit rumgespielt, hoffentlich kann mir hier jemand helfen.
Ich habe ein einfaches zweispaltiges Layout, die linke Seite ist eine Navigationsleiste mit Schaltflächen, die rechte Seite ist ein Inhaltsbereich. Wenn der Benutzer auf eine der Schaltflächen tippt (z. B. die dritte nach unten), möchte ich eine schwebende Ansicht haben, die rechts von dieser Schaltfläche ausgerichtet ist, aber über dem Inhaltsbereich schwebt. Hier ist ein Bild, um zu veranschaulichen, was ich meine:
Alles, was ich versucht habe, verschiebt das schwebende Menü in der Navigationsleiste oder im Inhaltsbereich, was nicht das ist, was ich will. Irgendwelche Ideen? Hier ist im Grunde, was ich bisher habe:
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal"
>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:orientation="vertical"
android:layout_alignParentLeft="true"
android:id="@+id/navigation_bar"
>
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.14"
>
<ImageButton
android:id="@+id/button1_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/icon"
android:layout_gravity="center"
/>
</FrameLayout>
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.14"
>
<ImageButton
android:id="@+id/button2_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/icon"
android:layout_gravity="center"
/>
</FrameLayout>
</LinearLayout>
<FrameLayout
android:id="@+id/content"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="0.14"
android:layout_toRightOf="@id/navigation_bar"
>
</FrameLayout>
</RelativeLayout>