2011-07-28 5 views
2

페이지가 있습니다. 그것은 서버에서 이미지를로드하고 4 개의 쌍으로 화면에 표시합니다. 일부 이미지는 크고 작습니다. 문제는 이미지가 클 때 이미지 뷰가 실제 이미지 크기로 확장된다는 것입니다. 나는 이미지의 크기에 상관없이 다른 3 개의 이미지를 교란시키지 않고 이미지 뷰에 적합해야한다. 그 XML은 "android : ImageView 높이 너비와 원본 이미지 피팅

<LinearLayout android:id="@+id/videolist" 
       android:orientation="vertical" 
       android:layout_width="fill_parent" 
       android:layout_height="fill_parent" 
       android:layout_below="@+id/trendingnowmanual" 
       android:layout_above="@+id/navigatevideo" 
       android:gravity="center_vertical|center_horizontal" 
       android:background="#ffffff" 
       android:layout_marginLeft="20dip" 
       android:layout_marginRight="20dip" 
       android:layout_marginTop="5dip" 
       android:layout_marginBottom="5dip" > 

       <LinearLayout android:layout_width="fill_parent" 
           android:layout_height="wrap_content" 
           android:gravity="center_vertical|center_horizontal" 
           android:layout_marginLeft="10dip" 
           android:layout_marginRight="10dip" 
           android:layout_marginTop="10dip" 
           android:layout_marginBottom="5dip" 
           android:layout_weight="100"> 
           <ImageView android:id="@+id/one" 
             android:src="@drawable/add1" 
             android:layout_width="wrap_content" 
             android:layout_height="wrap_content" 
             android:paddingRight="5dip" 
             android:layout_weight="50" 
             android:adjustViewBounds="true" 
              > 
           </ImageView> 
           <ImageView android:id="@+id/two" 
             android:src="@drawable/add2" 
             android:layout_width="wrap_content" 
             android:layout_height="wrap_content" 
             android:paddingLeft="5dip" 
             android:layout_weight="50" 
             android:adjustViewBounds="true" 
              > 
           </ImageView> 

       </LinearLayout>    
       <LinearLayout android:layout_width="fill_parent" 
           android:layout_height="wrap_content" 
           android:gravity="center_vertical|center_horizontal" 
           android:layout_marginLeft="10dip" 
           android:layout_marginRight="10dip" 
           android:layout_marginTop="5dip" 
           android:layout_marginBottom="10dip" 
           android:layout_weight="100" > 
           <ImageView android:id="@+id/three" 
             android:src="@drawable/add3" 
             android:layout_width="wrap_content" 
             android:layout_height="wrap_content" 
             android:paddingRight="5dip" 
             android:layout_weight="50" 
             android:adjustViewBounds="true" 
              > 
           </ImageView> 
           <ImageView android:id="@+id/four" 
             android:src="@drawable/add4" 
             android:layout_width="wrap_content" 
             android:layout_height="wrap_content" 
             android:paddingLeft="5dip" 
             android:layout_weight="50" 
             android:adjustViewBounds="true" 
              > 
           </ImageView> 
       </LinearLayout> 
    </LinearLayout> 

어떤 생각?

답변

4

사용 scaleType ="이다 fitXY "당신의 이미지 뷰에