Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

添加本地图片 #21

Open
lilongfeng2010 opened this issue Mar 1, 2018 · 1 comment
Open

添加本地图片 #21

lilongfeng2010 opened this issue Mar 1, 2018 · 1 comment

Comments

@lilongfeng2010
Copy link

大神,啥时候添加使用本地图片的功能啊?现在特别想用,就是不能添加本地图片。

@zornil
Copy link

zornil commented Mar 26, 2018

远程图片 http://, https:// HttpURLConnection 或者参考 使用其他网络加载方案
本地文件 file:// FileInputStream
Content provider content:// ContentResolver
asset目录下的资源 asset:// AssetManager
res目录下的资源 res:// Resources.openRawResource
Uri中指定图片数据 data:mime/type;base64, 数据类型必须符合 rfc2397规定 (仅支持 UTF-8)

用例:
Uri uri = Uri.parse("res://包名(实际可以是任何字符串甚至留空)/" + R.drawable.ic_launcher);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants