forum

Home / DeveloperSection / Forums / Imageview set height by programme

Imageview set height by programme

Anonymous User 2029 11-Oct-2014

I want to set the height of the image view programatically in gridview. I used below code-

imageview.getLayoutParams().height = height;

This is working fine in android version 4.3 and higher but not working in android version 4.2 and below. I can't find the issue. Any help please.

ImageView in xml-

<ImageView
 android:id="@+id/item_image"
 android:layout_width="match_parent"
 android:layout_height="wrap_content"
 android:scaleType="centerCrop"
 android:background="@drawable/top_radius" />


Updated on 11-Oct-2014
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By