9
나는 다음과 레이아웃 파일이 있습니다 (I 실제 장치에서 테스트했습니다 그것은 같은 모양) 에뮬레이터에wrap_content를 사용할 때 layout_marginBottom이 무시되는 이유는 무엇입니까?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#FF0000" >
<RelativeLayout
android:id="@+id/usericon_img"
android:layout_width="73.3334dp"
android:layout_height="70.6667dp"
android:layout_marginBottom="2.6667dp"
android:layout_marginLeft="3.3334dp"
android:layout_marginTop="2.6667dp"
android:background="#FFFFFF" />
</RelativeLayout>
를 레이아웃은 다음과 같습니다 이
내 질문은 : 왜 흰색 레이아웃 아래에 빨간 여백이 없습니까?
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="76dp"
android:background="#FF0000" >
내가 원하는 것을 얻을 수 있습니다,하지만하지 않는 이유 wrap_content가 제대로 작동 : 나는에 외부 레이아웃을 변경하면 알아? documentation에서
hdpi 화면에서 106 픽셀 크기를 원하기 때문에 70.6667을 사용했습니다. – Toorop
여백을 무시하는 경우 왜 왼쪽 및 위쪽 여백이 있습니까? – Toorop
패딩 대신 사용해보기 – Ahmad