我正在尝试在Android Studio中使用Glide来处理存储在R.drawable中的Gif动画,但我遇到了“无法解决符号'Glide'”的问题。
我已经在build.gradle中添加了Glide依赖项。
我已经在build.gradle中添加了Glide依赖项。
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.2.0'
compile 'com.github.bumptech.glide:glide:3.7.0'
}
我正在使用以下代码将图像视图设置为gif。
ImageView img=(ImageView)findViewById(R.id.catImg);
int resourceId = R.drawable.gangrycat;
Glide.with(this.context)
.load(resourceId)
.into(img);