Android 这是真的臭虫吗?

Android 这是真的臭虫吗?,android,background-color,Android,Background Color,我不知道为什么,但我的布局颜色只是停留在屏幕底部。 我不认为我的代码是这样做的 顺便问一下,有人知道从这样一个简单的布局中从何处获得灵感吗?文本视图和编辑文本 我的看起来糟透了 而不是这个: <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_par

我不知道为什么,但我的布局颜色只是停留在屏幕底部。
我不认为我的代码是这样做的

顺便问一下,有人知道从这样一个简单的布局中从何处获得灵感吗?文本视图和编辑文本

我的看起来糟透了


而不是这个:

<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">

因此,要在根视图组中移动背景色,请执行以下操作:

<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">


因此,要在根视图组中移动背景色,请在滚动视图中添加下一行。这会满足你的要求

android:fillViewport="true"

在滚动视图中添加以下行。这会满足你的要求

android:fillViewport="true"

@但它成功了。和蔼可亲。@Rotwang你知道我的案子很酷的布局吗?我的看起来很糟糕:/
Genius
太过分了<代码>经验丰富就足够了;)对于布局的想法,我建议你去谷歌搜索。您还可以找到可下载的模板。@Rotwang它起作用了。和蔼可亲。@Rotwang你知道我的案子很酷的布局吗?我的看起来很糟糕:/
Genius
太过分了<代码>经验丰富就足够了;)对于布局的想法,我建议你去谷歌搜索。您还可以找到可下载的模板。