1
我正在处理布局。 temp1包含在temp2中。 temp1工作正常,但是当我将它包含在temp2中时。它填充整个屏幕,因为temp1中的根被设置为fill_parent。在这种情况下可能有什么解决方案?包含布局在另一个布局中填充视图
我想在temp1中心的一个小区域temp2中显示布局。
temp1.xml
<RelativeLayout android:layout_height="fill_parent"
android:layout_width="fill_parent">
</RelativeLayout>
temp2.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:id="@+id/relativeLayout">
<include
android:layout_width="match_parent"
android:layout_height="match_parent"
layout="@layout/temp1"/>
</RelativeLayout>
</RelativeLayout>
是的,我意识到这一点,事实证明这是现在唯一的解决方案。谢谢你的回答。我必须给dp做一个尺寸来做我想做的事情。 – VendettaDroid 2013-03-14 22:56:10