이 레이아웃을 만들 때이 코드를 사용합니다.왜이 레이아웃에 약간의 공간이 있습니까?
<?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:layout_margin="20dp"
android:background="@android:color/transparent">
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_centerInParent="true"
android:background="@drawable/rounded_white_bg">
<EditText
android:id="@+id/login"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:background="@drawable/dialog_edittex"
android:layout_margin="10dp"/>
<EditText
android:id="@+id/password"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_margin="10dp"
android:background="@drawable/dialog_edittex"/>
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:textColor="@android:color/black"
android:text="AAAAAAAAAAAA"
android:layout_gravity="center"
android:textSize="20sp"
/>
<ImageView
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:src="@drawable/dialog_button_bg"/>
</LinearLayout>
</RelativeLayout>
rouded_whiite.bg.xml
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#ffffff" />
<corners
android:radius="20dp"/>
</shape>
하지만이 작업을 수행 할 때이 결과를 볼 수 있습니다. 보시다시피 빨간 버튼 아래에 여백이 있습니다. 나는 여백을 설정하지 않았지만 거기에는 약간의 공간이 있습니다. 주먹 이미지에서와 같이 정확한 결과를 얻으려면 여기에서 어떻게해야합니까?
android : layout_margin = "20dp"? –
'LinearLayout'과'RelativeLayout'에'android : padding = "0dp"'를 설정하려고 했습니까? – Fllo
왜 RelativeLayout을 사용하여 구현할 수 있는지 중첩 된 선형 레이아웃을 사용하고 있습니까? – r4jiv007