[英]Weird behavior of Button placing in Relative layout with AppCompatTheme
[英]problem placing Button/ListView under relative layout in layout XML
以下是我正在做的事情的布局 XML。 它应该在显示屏顶部显示和编辑字段和一些按钮,ListView 填充 rest。 然而,只有嵌入在 RelativeLayout 中的项目才会显示出来。 以下项目不显示。 我不确定我在布局 XML 中做错了什么。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<RelativeLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="10px">
<TextView android:id="@+id/tidName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:text="Enter Name:" />
<EditText android:id="@+id/eidName"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@android:drawable/editbox_background"
android:layout_below="@id/tidName" />
<Button android:id="@+id/bidShow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/tidName"
android:layout_alignParentRight="true"
android:layout_marginLeft="10px"
android:text="Show Search Results" />
<Button android:id="@+id/bidUseDefault"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/tidName"
android:layout_alignParentLeft="true"
android:layout_marginRight="10px"
android:text="Use Default" />
</RelativeLayout>
<Button
android:layout_below="@id/ridMain"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Refresh" />
<ListView android:id="@+id/lidResults"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</LinearLayout>
提前致谢,
在主布局上添加android:orientation="vertical"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.