android imageloader and imageview scaletype

457 views Asked by At

this is my imageI have an imageview element into relativelayout with textView like this

<RelativeLayout>
<ImageView
    android:id="@+id/image"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:adjustViewBounds="true"
   android:background="@color/darkblue"
    android:scaleType="fitXY"/>

  <TextView
    android:id="@+id/title"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"

android:layout_alignBottom="@+id/image"
android:paddingBottom="2dp"
android:gravity="bottom"
  android:paddingLeft="2dp"
  android:paddingRight="2dp"
   android:textSize="13sp"
   android:background="@drawable/gradient"
    android:textColor="@color/White"
     />

 </RelativeLayout>

I want to load the image using imageloader, but when i load the image the height of image does not fill all the relative layout, i try to use scaletype: fitcenter and still not working, i try to change the height of image pro grammatically but still not showing all height,

    image.getLayoutParams().height=(int) (screenWidth/2);
1

There are 1 answers

0
Vaizadoo On BEST ANSWER

Try android:scaleType="centerCrop" here u can read more about this