String imageName = "index_fragmen"+getColor(); final int resId = context.getResources().getIdentifier(imageName, "drawable", context.getPackageName()); if (resId != 0) { Log.e("mytest", "可以获取到"); holder.btnCoupon.setBackgroundResource(resId); }
时间: 2024-09-30 02:00:20