[英]Glide is loading half image
當我嘗試加載圖像時,我得到了這個結果:
這是我的簡單代碼:
Glide.with(this).load(R.drawable.girl_with_coffee_and_phone)
.placeholder(R.color.colorPrimary)
.into(mBackgroundImage);
這是我的活動布局:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/image_background"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"/>
</RelativeLayout>
難道我做錯了什么?
日志:
D/OpenGLRenderer: endAllActiveAnimators on 0x7842bfdc00 (InsetDrawable) with handle 0x783169e820
嘗試
Glide.with(this).load(R.drawable.girl_with_coffee_and_phone)
.centerCrop()
.into(mBackgroundImage);
從xml文件中刪除android:scaleType參數。
在您將要進行的活動中:
ImageView mBackgroundImage= (ImageView)findViewById(R.id.image_background);
我檢查了源代碼並找到了一個解決方法,只需在github中檢查我的項目
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.