我试图在TextView
之后的LinearLayout
中添加Button
,但它没有显示出来。按钮不显示在LinearLayout中
这里是我的布局代码
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/LinearLayout01"
android:layout_width="fill_parent"
android:layout_height="45dip">
<TextView android:layout_width="fill_parent"
android:layout_height="45dip"
android:paddingLeft="5dip"
android:paddingRight="5dip"
android:textStyle="bold"
android:textSize="17dip"
android:gravity="center_vertical"
android:id="@+id/tvChild"
android:text="Children"
android:textColor="#ffCCCC22" />
<Button android:id="@+id/submit"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:text="Submit" />
</LinearLayout>
的TextView
与正确的文本显示正常,但不是一个Button
我得到三到四线长度的一大空白。
我错过了什么?
变化的android:layout_width = “FILL_PARENT” 的TextView的到Android:layout_width = “WRAP_CONTENT” 或者 在你的LinearLayout标签添加机器人: orientation =“vertical” –
谢谢Kartik ..它的工作原理 – Codemator