[英]Glide not loading online Images
我在將在線圖像加載到 Glide 時遇到問題:我嘗試了這些代碼:
我的build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.devX.meta"
minSdkVersion 14
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile 'com.android.support:cardview-v7:27.0.0'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:27.0.0'
// implementation 'com.android.support.constraint:constraint-layout:1.1.3'
compile 'com.github.bumptech.glide:glide:3.8.0'
}
注意:我無法更改我的 API 級別
在不改變 gradle 的 Api 級別的情況下如何解決這個問題?
這是我調用的 Glide 代碼
主要活動
Glide.with(this).load("https://animevaya.000webhostapp.com/wp-content/uploads/2020/05/ic_launcher-web.png").placeholder(R.drawable.window).error(R.drawable.bg_white_text_red).into(ImgX);
有什么解決辦法嗎?
你可以試試最新版本
implementation 'com.github.bumptech.glide:glide:4.11.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
然后
RequestManager requestManager = Glide.with(this);
RequestBuilder requestBuilder = requestManager.load("your_url");
requestBuilder.into(imageViewOBJ);
compile
。 移至implementation
。AndroidX
。compileSdkVersion
應該是 29。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.