【发布时间】:2011-12-08 12:36:30
【问题描述】:
<RelativeLayout
android:id="@+id/relativeLayout1"
android:layout_width="fill_parent"
android:layout_height="365dp"
android:layout_margin="10dp"
android:background="@drawable/round_border" >
<RelativeLayout
android:id="@+id/relativeLayout2"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageButton
android:id="@+id/contactimg"
style="@style/CodeFont"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginBottom="10dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="20dp"
android:background="@drawable/round_border_imageview"
android:maxHeight="75dp"
android:maxWidth="75dp"
android:padding="2dp"
android:src="@drawable/icon"
android:textSize="15dp" >
</ImageButton>
</RelativeLayout>
<RelativeLayout
android:id="@+id/relativeLayout4"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@+id/relativeLayout2">
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_margin="20dp"
android:weightSum="1"
android:background="@drawable/round_border">
<TextView
android:id="@+id/TextView03"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="Textttt"
android:padding="10dp" />
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
android:id="@+id/relativeLayout5"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_marginTop="1dp"
android:layout_below="@+id/relativeLayout1"
>
<Button
android:id="@+id/replaymassegebutton"
android:layout_width="80dp"
android:layout_height="40dp"
android:layout_alignParentLeft="true"
android:layout_alignParentBottom="true"
android:layout_marginLeft="10dp"
android:background="@drawable/button_indicator"
android:text="Reply"
android:textColor="@color/gray2" >
</Button>
</RelativeLayout>
在 HVGA 模拟器中,它的措辞很好。但在另一个模拟器中却不是。如您所见,我输入了 height=365dp,(我必须更改高度,但我不知道如何,365dp 仅在 HVGA 模式下工作)我应该在这里做什么,以便它适用于所有模拟器。我尝试了 wrap_content 和 fill_parrent 但是当我设置这个参数时,按钮消失了(它们在另一个布局中)。我也试过这种方式 android:layout_weight="1" android:layout_height="0dp"。但这里没有结果。你能不能给我另一个解决方案
【问题讨论】:
-
需要更多... 1. 什么是父布局?线性的,相对的还是什么? 2.按钮总是在底部吗?并且您希望此 UI 覆盖屏幕上的剩余区域?编辑您的问题... 至少详细说明并添加您认为适合分享的任何内容.....这将使我们轻松发布答案
-
父布局是线性的。 Buttuns 必须在底部。
标签: android xml android-layout