简体   繁体   English

ViewImage根据用户输入进行更改

[英]ViewImage change based on user input

i am currently trying change a imageView in my program, it needs to changed based what the user picks from the screen before, so i was wondering how i can access an image in my drawable folder through a string path? 我当前正在尝试在程序中更改imageView,它需要根据用户从屏幕上选择的内容进行更改,因此我想知道如何通过字符串路径访问可绘制文件夹中的图像?

all the examples i have seen have been either hard coded (R.drawable.XXX) or asking for the integer id value 我见过的所有示例都经过了硬编码(R.drawable.XXX)或要求提供整数id值

Cheers 干杯

使用您的字符串作为键和ID作为值创建一个HashMap。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM