Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/400.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 我正在尝试在LinearLayout的底部放置一个按钮。但是它';它不显示_Java_Android_Xml_Android Layout - Fatal编程技术网

Java 我正在尝试在LinearLayout的底部放置一个按钮。但是它';它不显示

Java 我正在尝试在LinearLayout的底部放置一个按钮。但是它';它不显示,java,android,xml,android-layout,Java,Android,Xml,Android Layout,我是Android新手。我正在Udacity学习Android。但这一过程由来已久,一些错误正在发生。我无法处理这些错误 将数量\u文本\u视图的布局高度从匹配\u父项更改为包装内容: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" androi

我是Android新手。我正在Udacity学习Android。但这一过程由来已久,一些错误正在发生。我无法处理这些错误


数量\u文本\u视图
的布局高度从
匹配\u父项
更改为
包装内容

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context=".MainActivity">

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Quantity" />

    <TextView
        android:id="@+id/quantity_text_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:text="0"
        android:textColor="@color/black"
        android:textSize="16sp" />

    <Button
        android:id="@+id/button_id"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text=" Order" />

</LinearLayout>

或者,TextView应该占据第一个TextView之后的剩余高度

<TextView
        android:id="@+id/quantity_text_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="0"
        android:textColor="@color/black"
        android:textSize="16sp" />