是否可以使用字符串设置 ImageViews id?
我正在以编程方式添加 ImageViews,我想将 ID 设置为“IMG12a”之类的东西
ImageView image = new ImageView(this);
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(100, 100);
params.leftMargin = X;
params.topMargin = Y;
image.setLayoutParams(params);
image.setScaleType(ImageView.ScaleType.CENTER_CROP);
image.setImageResource(IMG);
image.setId(?????);
theLayout.addView(image);