ListActivity
의 각 행에 대한 배경을 만들려고합니다. 나는 두 개의 배경 이미지를 나란히 놓아야한다. 항목 아이콘의 자리 표시 자 역할을하는 leftshopitem
이미지와 텍스트 정보를 덮어 쓸 이미지 rightshopitem
이 있습니다.Android xml - 상대 레이아웃의 텍스트/이미지 오버레이
기본적으로 나는 다음과 같은 속성을 원합니다 : leftshopitem
이미지 위에 이미지 아이콘이 있어야하고 rightshopitem
이미지 위에 표시 할 textViews가 필요합니다.
현재로서는이 코드가 있습니다. 배경 이미지가 올바르게 정렬되어 표시되지만 아이콘과 텍스트는 올바르게 정렬되지 않습니다. 내 질문은, 어떻게 내가 그것의 위치에 상대적인 다른 개체를 배치 할 수 있도록 '부모'imageView을 만들 수 있습니다 것 같아요. "이 위치의 장소 다른 개체 상대를"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/relativeLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<ImageView
android:id="@+id/leftbackground"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:src="@drawable/leftshopitem" />
<ImageView
android:id="@+id/img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_centerInParent="true"
/>
<ImageView
android:id="@+id/rightbackground"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_toRightOf="@+id/leftbackground"
android:src="@drawable/rightshopitem" />
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="10dp"
>
<TextView
android:id="@+id/name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textColor="#000000"
/>
<TextView
android:id="@+id/weight"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textColor="#000000"
android:textSize="16sp"
/>
</LinearLayout>
</RelativeLayout>
모든 와이어 프레임 스냅? –