android - 使用 glide 从 firebase 获取图像并设置为回收器视图但图像未加载
问题描述
使用滑翔从火力基地获取图像并设置为回收器视图但图像未加载
upload uploadCurrent = mUploads.get(position);
Glide.with(mContext).load(uploadCurrent.getFilePathUri()).into(holder.mimageView);
holder.textViewname.setText(uploadCurrent.getProductName());
holder.textViewcontact.setText(uploadCurrent.getContactNumber());
holder.textViewprice.setText(uploadCurrent.getPrice());
解决方案
你可以用毕加索代替滑翔,
在您的 build.gradle 应用程序中
compile 'com.squareup.picasso:picasso:2.5.2'
然后
Picasso.with(mContext).load(uploadCurrent.getFilePathUri()).into(holder.mimageView);
如果它不起作用,请尝试确保uploadCurrent.getFilePathUri()
返回有效的 uri。
如果它返回一个有效的 uri,那么问题出在上下文可能尝试
Picasso.with(getApplicationContext()).load(uploadCurrent.getFilePathUri()).into(holder.mimageView);
如果仍然没有运气,那么最好的方法是删除毕加索并滑行并书写
holder.imageView.setImageUri(uploadCurrent.getFilePathUri());
而已。
推荐阅读
- python - 我不知道那个错误是什么意思以及如何解决这个问题。我想将 Country 键和 France 值添加到字典中
- google-apps-script - 如何使用 Apps 脚本删除 Google 表格中的行?
- javascript - 在 nodejs 中使用 import 通常使用 require
- javascript - 为什么我的构造函数状态属性没有发送到 server.js?
- swiftui - SwiftUI - Spotify Auth Webview 未在构建中加载但在预览中工作
- c++ - 无法将不同的结构值插入 Map
- java - 如何在 if 之间设置限制?
- javascript - 交互式 3d 动画注册和登录表格
- javascript - 为什么我的 Ionic App 在 Android 上收到强制“暗模式”?
- stm32 - STM32IDE 中的 CMSIS 问题