0

나는 listview의 항목을 정의하는 레이아웃을 가지고 있습니다. 나는 다음과 같이이 필요합니다 :레이아웃 밖으로 팽창 가능한 드로어 블

enter image description here

내가 빨간색 사각형 (이미지 뷰는) 두 개의은 LinearLayouts (I 업로드 한 이미지 참조)을 통해 오버레이 것을해야합니다.

나의 현재 목록 항목 레이아웃 :

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:background="@color/background" 
    android:paddingLeft="15dip" 
    android:paddingRight="15dip" > 

    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:background="@drawable/item_rounded" 
     android:padding="15dip" > 
    <TextView 
      android:id="@+id/text" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="Item 1" 
      android:textSize="16sp" /> 
    </LinearLayout> 
</LinearLayout> 

답변

1

이 레이아웃을 시도해보십시오

<RelativeLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" > 

    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:background="@color/background" 
     android:paddingLeft="15dip" 
     android:paddingRight="15dip" > 

     <LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:background="@drawable/item_rounded" 
      android:padding="15dip" > 

      <TextView 
       android:id="@+id/text" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:text="Item 1" 
       android:textSize="16sp" /> 
     </LinearLayout> 
    </LinearLayout> 

    <ImageView 
     android:layout_width="50dp" 
     android:layout_height="50dp" 
     android:layout_alignParentRight="true" 
     android:layout_centerVertical="true" 
     android:background="#FF0000" /> 
</RelativeLayout> 
+0

나는 이것을 시도하고 작동합니다. 고맙습니다. – traninho

0
Try below code 

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:background="#ffeecc" 
    android:paddingLeft="15dip" 
    android:paddingRight="15dip" > 
    <LinearLayout 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentRight="true" 
     android:background="@drawable/item_rounded" 
     android:padding="15dip" > 

    <TextView 
      android:id="@+id/text" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="Item 1" 
      android:textSize="16sp" /> 
    </LinearLayout> 
</RelativeLayout>