2016-02-07 132 views
0

我正在使用Parse(我知道這是一個垂死的服務)爲我提取和存儲圖片。這些內容包括經過認證的Facebook用戶個人資料圖片。圖片是50x50。如果我在本地下載鏡像,請將其放入drawables文件夾,然後通過XML(android:src="@drawable/dummy")加載它,這是結果。這就是我想要的:加載時圖片尺寸不正確

Expected result

但是,當我打開從解析圖像,並將其加載到CircularImageView,這是結果: enter image description here

正如你看到的,我的頭縮水:(

下面是一些代碼:

的CircularImageView在XML:

<de.hdodenhof.circleimageview.CircleImageView 
     android:id="@+id/main_list_profile" 
     android:layout_width="wrap_content" 
     android:layout_height="match_parent" 
     android:layout_marginLeft="@dimen/activity_horizontal_margin" 
     android:layout_marginRight="@dimen/activity_horizontal_margin" 
     android:layout_marginTop="@dimen/activity_vertical_margin" 
     android:layout_marginBottom="@dimen/activity_vertical_margin" 
     android:src="@drawable/dummy"/> 

經由載入畢加索庫圖像

Picasso.with(mContext).load(carItem.getUserPosted().getParseFile("profileThumb").getUrl()).noFade().into(viewHolder.profileImage); 

庫使用:

回答

1

Picasoo有調整大小的方法,你可以這樣使用它:

Picasso.with(context).load(img_url) 
       .resize(img_width, img_heghit).into(image_view); 
+0

完美!不能相信我錯過了這一點。 – jaytj95