상대 레이아웃과 배경을 사용할 때 문제가 있습니다. android:layout_height="match_parent"
으로 설정했지만 배경이 모든 화면 (화면 높이)을 채우지 않고 하단 부분이 흰색으로 설정됩니다. 나는 화면 상단에 항목을 넣을 뿐이지 만이 동작이 맞다고 생각하지는 않습니다.상대 레이아웃의 배경이 모든 화면을 채우지 않습니다.
내 코드 XML :
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/background" >
<TextView
android:id="@+id/title"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/title"
android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/dim_b"
android:layout_marginLeft="@dimen/dim_a"
android:layout_marginRight="@dimen/dim_a" />
<EditText
android:id="@+id/insert"
android:hint="@string/insert"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/title"
android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/dim_c"
android:layout_marginLeft="@dimen/dim_a"
android:layout_marginRight="@dimen/dim_a"
android:inputType="textPassword" />
<Button
android:id="@+id/accept"
android:text="@string/accept"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/insert"
android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/dim_d"
android:layout_marginLeft="@dimen/dim_a"
android:layout_marginRight="@dimen/dim_a" />
</RelativeLayout>
RelativeLayout의 모든 하위보기를 제거하여 시도해보십시오. 배경 drawable에 실수가있을 수 있습니다. – faylon