Image is stretched vertically while using Glide in Grid View Android -
i made app displays images stored locally in grid view.i used use picasso stopped using due many issues(it didn't load images on devices).then switched glide,everything fine except image stretched vertically. causes scrolling issue.i never faced such issue while using picasso.how can fix issue ???
my mainactivity code-
glide.with(mainactivity.this) .load(mthumbids[position]) .placeholder(r.raw.place_holder) .error(r.raw.big_problem) .centercrop() .into(imageview); return imageview;
my activity_main.xml file code
<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" xmlns:ads="http://schemas.android.com/apk/res-auto" android:background="@color/colorprimary" android:layout_height="match_parent"> <gridview android:id="@+id/gridview" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center" android:columnwidth="150dp" android:numcolumns="2" android:layout_above="@+id/adview" /> <com.google.android.gms.ads.adview android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/adview" ads:adsize="smart_banner" ads:adunitid="@string/banner_ad_unit_id" android:layout_alignparentbottom="true" android:layout_alignparentleft="true" android:layout_alignparentstart="true"> </com.google.android.gms.ads.adview> </relativelayout>
screenshot of problem-see image on right stretched vertically
i found out. it's because size of placeholder image didn't match original image.
my solution remove placeholder or resize placeholder
Comments
Post a Comment