2014-02-08 5 views
1

이미지 1을 이미지 2와 유사하게 만들기 위해 레이아웃을 어떻게 바꿀 수 있습니까? 위로 움직이는 텍스트이거나 위로 움직이는 이미지라면 괜찮습니다.Android ImageView 레이아웃 맞춤

What I have

What I need

내 레이아웃 파일과 같이이다 : -

<LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:weightSum="1" 
     android:orientation="horizontal" > 

     <LinearLayout 
      android:layout_width="0dip" 
      android:layout_height="wrap_content" 
      android:layout_weight="0.6" 
      android:orientation="vertical" > 

      <ImageView 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:src="@drawable/imp" /> 

     </LinearLayout> 

     <LinearLayout 
      android:layout_width="0dip" 
      android:layout_height="wrap_content" 
      android:layout_weight="0.4" 
      android:orientation="vertical" > 

      <LinearLayout 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:orientation="horizontal"> 

       <TextView 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:text="@string/stats_chr" /> 
       <TextView 
        android:layout_width="0dip" 
        android:layout_height="wrap_content" 
        android:layout_weight="1" 
        android:gravity="right|center_vertical" 
        android:singleLine="true" 
        android:text="AA" /> 
      </LinearLayout> 
+0

'LinearLayout'과'ImageView'에 모두 중력을 설정하려고합니다. android : layout_gravity = "top"' –

+1

Dungeon crawling cat! –

답변

0

이 시도 ..

LinearLayout 또는 android:layout_gravity="top"에 대한 사용 android:gravity="top"ImageView

,369에 대한
4

허용되는 대답은 저에게 적합하지 않습니다. 여기 내 해결책은

android : scaleType = "fitStart"를 ImageView에 추가하십시오.

+0

네,이게 저에게 효과적이었습니다. –

관련 문제