这是一个真正的错误吗?

Is this a real bug?

不知道为什么,我的布局颜色就停在了屏幕底部。
我不认为我的代码会那样做。

而且,顺便说一下,有谁知道从哪里可以从像这样的简单布局中获得灵感? TextViews 和 EditTexts?

我的看起来很糟糕

<ScrollView 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:background="@color/AMOB_gray" 
tools:context="com.example.tiagosilva.amob_android.TubeDataFragment" >

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:padding="20dp"
    android:gravity="center"
    android:background="@color/AMOB_gray">


<TextView
    android:id="@+id/textView13"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:gravity="center"
    android:text="@string/material"
    android:textColor="@color/AMOB_yellow"
    android:textSize="25dp" />

<Spinner
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/snipperMaterial">
</Spinner>

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/diameter"
    android:textColor="@color/AMOB_yellow"
    android:textSize="25dp" />

<EditText
    android:id="@+id/et_diameter"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="@drawable/round"
    android:ems="10"
    android:inputType="number"
    android:padding="10dp"
    android:text="0"/>

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/thickness"
    android:textColor="@color/AMOB_yellow"
    android:textSize="25dp"
    android:gravity="center"/>

<EditText
    android:id="@+id/et_thickness"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="@drawable/round"
    android:ems="10"
    android:inputType="number"
    android:padding="10dp"
    android:text="0"/>

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/clr"
    android:textColor="@color/AMOB_yellow"
    android:textSize="25dp"
    android:gravity="center"/>

<EditText
    android:id="@+id/et_clr"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="@drawable/round"
    android:ems="10"
    android:inputType="number"
    android:padding="10dp"
    android:text="0"/>

<Button
    android:id="@+id/btn_save_tube"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="@drawable/round_buttons"
    android:text="@string/save"
    android:textColor="@color/AMOB_gray"
    android:layout_marginTop="10dp"/>

</LinearLayout>

</ScrollView>

而不是这个:

<ScrollView 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"
tools:context="com.example.tiagosilva.amob_android.TubeDataFragment" >

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:padding="20dp"
    android:gravity="center"
    android:background="@color/AMOB_gray">

试试这个

<ScrollView 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"
tools:context="com.example.tiagosilva.amob_android.TubeDataFragment" 
android:background="@color/AMOB_gray">

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:padding="20dp"
    android:gravity="center">

所以要移动rootViewGroup

里面的背景色

在滚动视图中添加下行。这会做你想做的

android:fillViewport="true"