我正在尝试在 Android Studio 中使用 glide 来处理来自 R.drawable 中存储的资源的 Gif 动画,但我得到“无法解析 sysmbol 'Glide'”。
我在 builde.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'
}
Run Code Online (Sandbox Code Playgroud)
我正在使用以下代码将图像视图设置为 gif。
ImageView img=(ImageView)findViewById(R.id.catImg);
int resourceId = R.drawable.gangrycat;
Glide.with(this.context)
.load(resourceId)
.into(img);
Run Code Online (Sandbox Code Playgroud)