유니버설 이미지 로더를 사용하여 일부 이미지를 가져 와서 목록보기에 표시하고 있습니다. 레이아웃이 올바르게 보이지 않는데 문제가 있습니다. 이미지의 너비가 25 %를 넘지 않기를 바란다. Eclipse의 Graphical Layout보기에서보기에는 좋지만 이미지를 다운로드하면 너무 큰 전체 크기로 표시된다. 전체 너비가 무엇인지 알지 못해서 maxwidth
을 사용하지 않기를 바랬습니다.유니버셜 이미지 로더가 layout_weight를 따르지 않습니다.
iv.setAdjustViewBounds(true);
하는 가치가있을 수도 있습니다 :
이 내가 너무 UIL과 함께 사용되는 ImageViews의 크기가 몇 가지 문제가 있었다이 나를 도와
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal"
android:padding="10dp"
android:weightSum="100" >
<ImageView
android:id="@+id/imgIcon"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_gravity="center_vertical"
android:layout_weight="25"
android:contentDescription="@string/offerImage"
android:paddingRight="10dip"
android:src="@drawable/ic_launcher" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="75"
android:orientation="vertical" >
<TextView
android:id="@+id/txtTitle"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:text="tempString"
android:textColor="#ffffffff"
android:textSize="18sp" />
<TextView
android:id="@+id/txtRetailer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Business name"
android:textColor="#ffffffff"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:id="@+id/txtDistance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:text="99.99 miles"
android:textColor="#ffffffff"
android:textSize="12sp"
android:textStyle="bold" />
</LinearLayout>
ImageView의 scaleType 속성을 살펴볼 수 있습니다. http://developer.android.com/reference/android/widget/ImageView.ScaleType.html –
'ImageView'와'LinearLayout' 둘 다'layout_width' 값을'0dip'으로 설정하려고 시도했습니다 –
그 트릭을했습니다 :-) 고마워요 vmironov. 답으로 답장을하고 싶으면 받아 들일 것입니다. – Darren