public static int getimages(String name){ Class drawable = R.drawable.class; Field field = null; try { field =drawable.getField(name); int images = field.getInt(field.getName()); return images; } catch (Exception e) { e.printStackTrace(); } return 0; }
Android根据图片名称加载Drawable里面的图片并且显示
最新推荐文章于 2022-12-01 19:32:05 发布