0
我有一个80 ImageView的活动,我必须在我的java文件中添加引用&我这样做。有没有什么方法可以简化这段代码。请帮帮我。如何优化这个引用语句findViewById()
iv[0]=(ImageView)findViewById(R.id.iv0);
iv[1]=(ImageView)findViewById(R.id.iv1);
iv[2]=(ImageView)findViewById(R.id.iv2);
iv[3]=(ImageView)findViewById(R.id.iv3);
iv[4]=(ImageView)findViewById(R.id.iv4);
iv[5]=(ImageView)findViewById(R.id.iv5);
.......
iv[79]=(ImageView)findViewById(R.id.iv79);
为什么您的活动有80图像浏览? –