Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xamarin Android:从RecyclerView上的Localpath加载图像_Android_Xamarin_Xamarin.android_Android Recyclerview - Fatal编程技术网

Xamarin Android:从RecyclerView上的Localpath加载图像

Xamarin Android:从RecyclerView上的Localpath加载图像,android,xamarin,xamarin.android,android-recyclerview,Android,Xamarin,Xamarin.android,Android Recyclerview,Xamarin Android项目使用了RecyclerView中显示的数据。我参考了本文并运行了代码示例,还参考了Xamarin中的ImageLoading组件。如何从移动本地路径获取图像,如文件imgFile=new文件(“/storage/simulated/0/Pictures/CameraAppDemo/myPhoto_2eb3b135-5ad5-4a17-8836-13a9eca6bb2.jpg”)?请参阅资源加载章节 这应该根据文档进行操作。不要忘记请求外部存储访问权限 var i

Xamarin Android项目使用了RecyclerView中显示的数据。我参考了本文并运行了代码示例,还参考了Xamarin中的ImageLoading组件。如何从移动本地路径获取图像,如
文件imgFile=new文件(“/storage/simulated/0/Pictures/CameraAppDemo/myPhoto_2eb3b135-5ad5-4a17-8836-13a9eca6bb2.jpg”)

请参阅
资源加载章节

这应该根据文档进行操作。不要忘记请求外部存储访问权限

var imgFile = new File("/storage/emulated/0/Pictures/CameraAppDemo/myPhoto_2eb3b135-5ad5-4a17-8836-13a9eca6bbb2.jpg")
Picasso.With(context)
       .Load(imgFile)
       .Into(imageView3);

注意:在mainfestfile中允许写入外部存储的权限

在此方法中在recyclerview中加载图像时出错!。有带毕加索样品的回收视图吗?
    File imgFileone = new  File("/sdcard/Images/imageName.jpg");

if(imgFileone.exists()){

    Bitmap myBitmap = BitmapFactory.decodeFile(imgFileone.getAbsolutePath());

    ImageView myImage = (ImageView) findViewById(R.id.imageviewCheck);

    myImage.setImageBitmap(myBitmap);

}