【发布时间】:2014-04-01 01:34:14
【问题描述】:
我有一个相对布局,如下所示
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/profile_pic"
android:layout_width="@dimen/small_size"
android:layout_height="@dimen/small_size"
android:layout_alignParentLeft="true"
android:src="@drawable/some_image" />
<ImageView
android:id="@+id/extra_pic"
android:layout_width="@dimen/large_size"
android:layout_height="@dimen/large_size"
android:layout_alignBottom="@id/profile_pic"
andorid:layout_toRightOf="@id/profile_pic" />
</RelativeLayout>
我需要将其保留为相对布局,因为原始布局文件看起来比这更复杂。
viewGroup 的高度只包裹了profile_pic 的高度,由于extra_pic 的高度较大,它被截断了。如何将 relativeLayout 获取到 wrap_content 以便它包装布局中的最大项目?
我想要的样子:
现在是什么样子
【问题讨论】:
-
它现在看起来怎么样?您希望它是什么样子?
-
你应该附上一张图片来展示它现在的样子。
-
我附上了两张图片供参考
标签: android android-layout android-xml