我有3个孩子的相对布局。layout_below在RelativeLayout中不起作用
- 1st是ImageView的封面。
- 第二个是ImageView头像中心的父母和
- 第三个是TextView应用程序名称下面的头像和中心水平。
在理论上它应该工作,但我的布局不会将文本放置在头像下方。 RelativeLayout有什么问题?
P/S:我已经试过android:layout_below="@+id/logo2"
和android:layout_below="@id/logo2"
,但仍然没有工作!
谢谢!
这是我的xml布局。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:src="@drawable/android_apple"/>
<ImageView
android:id="@+id/logo2"
android:layout_width="64dp"
android:layout_height="64dp"
android:layout_centerInParent="true"
android:src="@drawable/default_avatar"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/logo2"
android:layout_centerHorizontal="true"
android:text="AAAAAAA"
android:textStyle="bold"/>
</RelativeLayout>
而结果:
我需要的布局高度等于ImageView封面高度 – phamxuanlu
您需要将封面图像显示在整页上吗? –
我的封面图片的高度未满屏幕。我只想用3个孩子的一个RelativeLayout。那是RelativeLayout的bug吗? – phamxuanlu