如何在Android中使用文件路径将图像设置为imageView [英] How to set an image to imageView using filepath in android
本文介绍了如何在Android中使用文件路径将图像设置为imageView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用浏览按钮获取图像的文件路径....之后,我想将此图像设置为使用文件路径的图像视图
I am getting file path of image by using browse button....after that I want to set this image to an image view using the file path
推荐答案
如果使用 File
,您的意思是 File
对象,我会尝试:
If with File
you mean a File
object, I would try:
File file = ....
Uri uri = Uri.fromFile(file);
imageView.setImageURI(uri);
这篇关于如何在Android中使用文件路径将图像设置为imageView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文