我有这个问题,我需要把TextView的(绿色)内下方的RelativeLayout(黑色),但ImageView的(橙色)的RelativeLayout(蓝色)保持重叠如何将TextView放置在另一个RelativeLayout的RelativeLayout中?
这里的传说:
- RelativeLayout的(黑色)ID/image_view_container
- ImageView的(褐色)
- RelativeLayout的(蓝色)
- ImageView的(橙色)ID/profileImage
- 的TextView(绿色)
我想:
android:layout_toRightOf="@id/profileImage"
android:layout_below="@id/image_view_container"
,但它不工作,可能是因为image_view_container
是从另一个RelativeLayout的。
我需要帮助,谢谢!
编辑:
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/image_view_container" >
<ImageView
android:id="@+id/mainImage"
android:layout_width="fill_parent"
android:layout_height="210dp"
android:background="#ffffff"
/>
</RelativeLayout>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="-30dp"
android:gravity="bottom"
android:orientation="horizontal" >
<ImageView
android:id="@+id/profileImage"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginLeft="20dp"
android:layout_weight="0"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:scaleType="centerCrop"
/>
<TextView
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_below="@id/image_view_container"
android:layout_toRightOf="@id/profileImage"
android:layout_weight="1"
android:text="6363"
android:textColor="@color/A"
android:textSize="20sp"
android:textStyle="bold"
android:translationY="5dp" />
</RelativeLayout>
后完整的XML请,好像你的蓝相对布局容器不是道具呃 –
你怎么包括_the other_ layout? – ozbek
请发布您的整个XML文件... – Shrikant