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" />