【发布时间】:2017-10-11 00:06:28
【问题描述】:
所以我有一个从 Firebase 存储加载图片的回收视图。我使用 Glide 库和 FirebaseImageLoader 来实现这一点。直到上周一,一切都运行良好。图像不再显示,没有错误、异常或其他帮助我弄清楚图像不再加载的原因:这里有一些代码 sn-ps:
分级:
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.firebaseui:firebase-ui-storage:1.2.0'
ImageView 我用来显示图片的:
<ImageView
android:layout_width="match_parent"
android:layout_height="130dp"
android:id="@+id/imageView_promotions"
android:scaleType="centerCrop"/>
构建 Firebase 存储链接的 Java 代码:
public StorageReference getThumbUri(String municipality){
return Constants.STORAGE_REFERENCE.child(Constants.PROMOTIONS).child(municipality).child(promo_thumb);
//returns e.g. gs://myfirebaseapp.com/promotions/Mahikeng/spar_thumb.png
}
加载图片的代码:
Glide.with(context).using(new FirebaseImageLoader()).load(promotions.get(position).
getThumbUri(municipality)).into(holder.imageView_promotions);
附注这段代码一直运行良好,从未改变过我向上帝发誓的任何东西。我所做的只是将我的 Android Studio 更新到 2.3.1 并将 Google 支持库更新到 25.3.1
【问题讨论】:
标签: android firebase firebase-storage android-glide