比如说:字符串”R.mipmap.a“,项目中需要把它转换对应的int类型资源id,可以这么用:
context.getResources().getIdentifier("a","mipmap",context.getPackageName());
其实就是一个拼接的过程。
比如说:字符串”R.mipmap.a“,项目中需要把它转换对应的int类型资源id,可以这么用:
context.getResources().getIdentifier("a","mipmap",context.getPackageName());
其实就是一个拼接的过程。