Ich möchte ein Framelayout unterhalb einer Ansicht ausrichten, bei der das Attribut centerInParent in einem relativen Layout auf true festgelegt ist. Ich habe versucht, layout_below, aber es funktioniert nicht. dann habe ich versucht, centerInParent zu entfernen und center_horizontal und center_vertical versucht, aber es hilft auch nicht, das FrameLayout immer noch an der Spitze des Layouts. Hier ist mein Layout-Code:Ausrichten einer unterhalb der übergeordneten Ansicht zentrierten Ansicht in einem relativen Layout
<android.support.percent.PercentRelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="?actionBarSize"
android:layout_marginTop="?actionBarSize"
android:background="@android:color/transparent">
<ImageView
android:id="@+id/backdrop"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"
android:fitsSystemWindows="true"
android:scaleType="centerCrop"
app:layout_collapseMode="parallax"
app:layout_collapseParallaxMultiplier="0"
tools:src="@drawable/car_engine" />
<View
android:id="@+id/center_point"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:background="@color/g" />
<View
android:id="@+id/tab_scrim"
android:layout_width="match_parent"
android:layout_height="@dimen/gradiant_height"
android:layout_alignParentBottom="true"
android:background="@drawable/tab_scrim"
app:layout_heightPercent="40%" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/center_point">
<TextView
android:id="@+id/car_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="5dp"
android:paddingTop="2dp"
android:textAlignment="center"
android:textColor="@color/w"
android:textSize="20sp"
android:textStyle="bold"
tools:text="@string/car_header_text" />
<TextView
android:id="@+id/car_subtitle"
style="@style/TitleWhite"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/car_title"
android:paddingBottom="4dp"
android:paddingTop="4dp"
android:text="@string/car_sub_header"
android:textAlignment="center" />
</FrameLayout>
</android.support.percent.PercentRelativeLayout>
Sie sollten die Höhe des PercentRelativeLayout ändern "match_parent" – sJy