根据图片名字在drawable中得到图片

  1. int imageId = context.getResources().getIdentifier("图片的名字","drawable", "包名");
  2. //iv是ImageView
  3. iv.setImageResource(imageId );
posted @ 2018-09-11 16:40  brave-sailor  阅读(315)  评论(0编辑  收藏  举报