Programming/Android

Realative layout에서 쉽게 범하는 오류

커널제로 2011. 8. 19. 16:33
<EditText
android:layout_height="wrap_content"
android:layout_width="150dp"
android:id="@+id/id" />
 <TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/loginidtext"
android:text="아이디"
android:layout_toLeftOf="@id/id" />

이렇게 쓰면 안된다. 왼쪽상단부터 레이아웃이 그려져야 되는데 텍스트뷰는 에디트 뷰를 참고하고 있으므로
에디트텍스트보다 왼쪽으로 정의 할 수 없어 겹쳐서 나오게 된다.