您好,我正在设计一个Android应用程序。Android将背景颜色填充到整个高度
我为我的活动添加了背景颜色。我的问题是如果只有内容,背景颜色会填满整个屏幕。目前看起来像这样。
只有一半的页面充满了背景色。
有人可以帮我填充整个背景的颜色。
这是我的xml代码。
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ScrollView01"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context="lk.agent.certislanka.certisagenttracking.ForgotPassword"
android:background="#ffd4d4d4">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="@string/forgot_password"
android:id="@+id/txt_v_forgot_password"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true"
android:layout_marginTop="64dp" />
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textEmailAddress"
android:singleLine="true"
android:hint="Enter Email Address"
android:ems="10"
android:id="@+id/et_email"
android:layout_below="@+id/txt_v_forgot_password"
android:layout_alignParentStart="true"
android:layout_marginTop="33dp" />
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/Submit"
android:id="@+id/btn_reset_password"
android:background="#F89B22"
android:layout_below="@+id/et_email"
android:layout_alignParentEnd="true"
android:layout_marginTop="22dp" />
</RelativeLayout>
</ScrollView>