<?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="#ffffff"
android:padding="5dip"
>
<ImageView
android:id="@+id/pic"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/picman"
/>
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="4px"
android:layout_toRightOf="@id/pic"
android:textSize="20sp"
android:text="홍길동"
/>
<TextView
android:id="@+id/phone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignBaseline="@id/title"
android:textSize="12sp"
android:text="015-123-4567"
/>
<Button
android:id="@+id/delButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/pic"
android:text="Del"
/>
<TextView
android:id="@+id/contents"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/delButton"
android:layout_below="@id/title"
android:layout_alignLeft="@id/title"
android:layout_centerVertical="true"
android:text="우리 딸래미가 처음 그린 그림이다. 누구를 그린것인지는 알 수 없으나 머리카락이 몇올 없는 것으로 보아 갓 태어난 동새을 그린 것으로
추측된다. 본인도 기억이 나지 않는다 하여 확인할 방법은 없다."
/>
</RelativeLayout>
문제점분석
1) 전화번호 배치 틀린이유
android:layout_alignParentRight="true" 와 동시에 android:layout_toRightOf="@id/title" 를 썼더니
title에 바짝 붙어버렸다. 아예 오른쪽 정렬을 하고자 할때는 alignParentRight가 맞구나.
(사실 좀만 생각해봐도 나왔을 답이였는데)
2) Contents 배치가 겹쳐버린 이유
android:layout_alignLeft="@id/title" 요부분 빼먹어서.
이런거 한번해보니까 배치가 어떻게 돌아가는지 충분히 감이 오는구마....