Ich versuche, ein RelativeLayout mit zwei ImageButtons in einem FrameLayout zu platzieren, das bereits über ein ImageView und ein LinearLayout verfügt. Ich muss das Relative Layout so platzieren, dass die obere Hälfte des ImageButton das ImageView überlappt und die untere Hälfte das LineLayout überlappt.Platzieren Sie Schaltflächen zwischen zwei Layouts im Android-Rahmenlayout
Meine aktuelle Layout ist wie folgt:
Mein aktueller xml ist:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#f2f2f2"
android:elevation="8dp"
android:orientation="vertical">
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:background="#fff"
android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="180dp"
android:src="@drawable/fire_icon" />
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="@color/colorblue"
android:orientation="vertical"
android:padding="10dp"
android:layout_margin="10dp">
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:text="Need Help"
android:textColor="@color/colortitletext"
android:textSize="18sp"
android:textStyle="bold" />
<TextView
android:id="@+id/description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="Hello, I am trying to create a android layout."
android:textColor="@color/colorheadtext"
android:textSize="18sp" />
</LinearLayout>
</LinearLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center|right"
android:layout_marginRight="15dp">
<ImageView
android:id="@+id/imageView4"
android:layout_width="60dp"
android:layout_height="50dp"
android:layout_alignParentTop="true"
android:layout_toLeftOf="@+id/imageView3"
android:layout_toStartOf="@+id/imageView3"
android:src="@drawable/ic_menu_camera" />
<ImageView
android:id="@+id/imageView3"
android:layout_width="60dp"
android:layout_height="50dp"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:src="@drawable/ic_menu_gallery" />
</RelativeLayout>
</FrameLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
Blick auf meine Antwort haben ... .... – sushildlh