我尝试使用按钮更新我的 imageiew
private void visitUpdateImage(int type) {
if(type == 0){
if(ecran != 1){
ecran--;
}
}
else if(type == 1){
if(ecran != nbEcrans){
ecran++;
}
}
int[] images = new int[nbEcrans];
images[0] = R.drawable.ecran1;
images[1] = R.drawable.ecran2;
images[2] = R.drawable.ecran3;
images[3] = R.drawable.ecran4;
images[4] = R.drawable.ecran5;
images[5] = R.drawable.ecran6;
images[6] = R.drawable.ecran7;
ImageView image = (ImageView) findViewById(R.id.imageView);
image.setImageResource(images[ecran - 1]);
System.out.println(ecran);
}
开始是好的,但图像[5] il 加载 ic_launcher 而不是 ecran6 并且图像[6] 什么也不加载
我所有的可绘制存储库中都有我所有的 ecrans
感谢帮助