I 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);
Try
android:scaleType="centerCrop"
here u can read more about this