2016-10-11 145 views
2

我試圖在Android Studio中使用滑翔來處理來自存儲在R.drawable中的資源的Gif動畫,但我得到「無法解析sysmbol'滑翔'」。Android Studio - 無法解析符號'Glide'

我在builde.gradle

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); 
+0

我已經設法解決它和TBH我覺得有點愚蠢。 –

回答

1

我已經設法解決了我的問題和TBH我覺得有點愚蠢。

我忘了下載滑行庫並導入它。

完整說明,可以發現here