我想使用RecyclerView创建图片库,在其中使用手机中的图片。我找不到任何用File类型填充图像的RecyclerView适配器。是否可以?
有关RecyclerView适配器的基本功能:http : //guides.codepath.com/android/Using-the-RecyclerView
在中onBindViewHolder
,您可以得到如下图像:
String path = Environment.getExternalStorageDirectory() + "/myImage.jpg";
Bitmap bitmap = BitmapFactory.decodeFile(path);
并将其与ImageView或类似的东西一起使用。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句