intellignt_idiot intellignt_idiot - 5 months ago 72
Android Question

Android ImageView , image gets cut off at the top Left corner, how to avoid id?

I have an imageView with

scaleType="centerCrop"


The images are showing inside ViewPager with sliding functionality.
I am using picasso to load images, but the image gets cut off on the top left corner like below :

enter image description here

enter image description here

Here is the xml code :

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
>

<ImageView
android:id="@+id/img_sliding"
android:scaleType="centerCrop"
android:layout_width="match_parent"
android:layout_height="match_parent" />




And the code to load images is :

if (imgList!=null && imgList.size()>0)
Picasso.with(getActivity())
.load(imgList.get(position))
.placeholder(drawable)
.into(imgView);


So, I can't figure out why this is happening, and also the cut of part is covered sometime by blue color and sometimes by green color.

Any help is appreciated.
Thanks

Answer

Try this one this will helps you You have enabled debug indicators on your Picasso instance (see official website). Look for setIndicatorsEnabled(true) in your code and remove it.

Hope you got your ans. Cheers!