0
我已保存的图像文件系统例如路径的UIImageView设置图像是从文件系统
file:///private/var/mobile/Containers/Data/Application/B6DDB8AB-0F53-4DFB-A6E7-F94EBBE29F81/tmp/53bea156-8af2-4bdf-b9cc-5f160fa88d01.png
然后我有以下代码来设置的UIImageView的形象:
var path = "file:///private/var/mobile/Containers/Data/Application/B6DDB8AB-0F53-4DFB-A6E7-F94EBBE29F81/tmp/53bea156-8af2-4bdf-b9cc-5f160fa88d01.png";
private UIImageView imageView;
imageView.Image = UIImage.FromFile(imageName);
这不工作,但是.....我如何设置UIImageView的图像保存在上述路径设备上的文件?
您应该使用'UIImage.FromFile(path)'而不是'UIImage.FromFile(imageName)',然后检查文件是否存在于路径上。 'if(File.Exists(path))' –