2014-01-17 5 views
1

나는 동적으로 확대 된 레이아웃을 가지고 있으며 레이아웃의 맨 아래에 항상 붙어 있기를 원하는 이미지 뷰가 있습니다.레이아웃에 android : layout_height = "wrap_content"속성이있는 경우 레이아웃의 맨 아래에 요소를 설정할 수 있습니까?

<LinearLayout 
    android:id="@+id/bot" 
    android:layout_width="300dip" 
    android:layout_height="wrap_content" > 

    <LinearLayout 
     android:id="@+id/descripcion" 
     android:layout_width="170dip" 
     android:layout_height="wrap_content" 
     android:orientation="horizontal" > 

    <TextView 
     android:id="@+id/la_descripcion" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:text="dfsasdfasfadfasdfasdfasdfasdfasdjfas sdf sadf sadf trh h t 5454 dsdfjsdf sdfsdfhk sdf f sdf hk sdf " 
     android:textColor="#ffffff" 
     android:textSize="11sp" 
     android:paddingLeft="12dp"/> 


    <ImageView 
     android:id="@+id/img_tag" 
     android:layout_width="5.84mm" 
     android:layout_height="4.21mm" 
     android:scaleType="centerInside" 
     android:background="@drawable/agotado" 

     /> 

    </LinearLayout> 

를 다음과 같이 내 코드는 텍스트 뷰 "la_descripción는"이상했다 경우 "있는 LinearLayout은"경우 어떻게해야 그 바닥

+0

상대 레이아웃을 사용하는 데 문제가 있습니까? – Saqib

답변

2
<ImageView 
    android:id="@+id/img_tag" 
    android:layout_width="5.84mm" 
    android:layout_height="4.21mm" 
    android:scaleType="centerInside" 
    android:background="@drawable/agotado" 
    android:layout_gravity="bottom" 
    /> 

에서 이미지를 확대 것이지만, 고정 유지 것이며 아니다 LinearLayout을 계속 사용하려면 RelativeLayout으로 전환하십시오.

<ImageView 
    android:id="@+id/img_tag" 
    android:layout_width="5.84mm" 
    android:layout_height="4.21mm" 
    android:scaleType="centerInside" 
    android:background="@drawable/agotado" 
    android:alignParentBottom="true" 
    /> 
+0

android : layout_gravity = "bottom": D 직장^u ^. Gracias : D – cheloncio

+0

미안, 그게 내 뜻이다. 기쁜 데 도움이되었습니다. –

관련 문제