/** * 根据图片的名称获取对应的资源id * @param resourceName * @return */ public int getDrawResourceID(String resourceName) { Resources res=getResources(); int picid = res.getIdentifier(resourceName,"drawable",getPackageName()); return picid; }
时间: 2024-09-29 03:49:32