我想在RecyclerView中加载多个drawable-resources,我在RecyclerView.ViewHolder中使用Picasso来完成这项任务。
Picasso.with(上下文) .load(imageList.get(位置)) .into(ImageView的);
Picasso加载drawable资源,这些资源位于drawable文件夹中,但不会从其他drawable中加载资源。
例如,如果我将drawables放在除“drawable”文件夹之外的所有可绘制文件夹(mdpi,hdpi,xhdpi等)中,它就不起作用。
那么我缺少什么?是否可以使用Picasso动态引用drawable?
答案 0 :(得分:2)
毕加索应该加载mipmap。尝试强制只显示一个,比如
Picasso.with(context).load(R.mipmap.ic_launcher).into(imageView);
并查看是否正在加载。如果是,那么你的id就是来自数组。