TextView
아래의 이미지를 RelativeLayout
에 위치 시키려고하는데 작동하지 않습니다. 내가 android:layout_below
을 사용하여 위치를 설정할 때. 이것은 내 XML입니다Android의 상대 레이아웃에서 이미지보기의 위치를 설정하려면 어떻게해야합니까?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:background="#ccc"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:id="@+id/app_details_1"
android:text="@string/app_details_1"
android:textColor="#347"
android:gravity="center"
android:textSize="9pt"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<ImageView
android:id="@+id/logo"
android:src="@drawable/secs"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_below="@+id/appdetails_1" <!-- I'm setting it here -->
/>
</RelativeLayout>
대신 화면의 왼쪽 상단에 이미지가 배치됩니다. 어떻게 배치합니까? layout_below
위치 코드가 잘못 되었습니까?
완전히 설명하려면 :'+ id'는이 ID를 생성해야하는 바로 가기입니다. 기존 ID를 참조 할 때, 그것은 단지'id'입니다. 이것에 관한 공식 문서 : http://developer.android.com/guide/topics/ui/declaring-layout.html#id –
또한 'app_details_1' 대신'appdetails_1' 오타가 있습니다 – Ronnie
@ user7777777777 예, 유일한 실수입니다. 더하기 부호는 오류가 아닙니다. – Michael