gpt4 book ai didi

java - 我可以把它放到一个for循环中吗?

转载 作者:行者123 更新时间:2023-11-29 10:20:17 25 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
android: how to elegantly set many button IDs

这是一个用eclipse制作的android程序。我试过使用字符串连接代替 imageButton1 无济于事。 R 是生成的类,所以我无法进入它并对其进行编辑,以使 imageButtons 成为数组的一部分。如何将其放入 for 循环?

    seatButton[0] = (ImageButton) findViewById(R.id.imageButton1);
seatButton[1] = (ImageButton) findViewById(R.id.imageButton2);
seatButton[2] = (ImageButton) findViewById(R.id.imageButton3);
seatButton[3] = (ImageButton) findViewById(R.id.imageButton4);
seatButton[4] = (ImageButton) findViewById(R.id.imageButton5);
seatButton[5] = (ImageButton) findViewById(R.id.imageButton6);
seatButton[6] = (ImageButton) findViewById(R.id.imageButton7);
seatButton[7] = (ImageButton) findViewById(R.id.imageButton8);
seatButton[8] = (ImageButton) findViewById(R.id.imageButton9);
seatButton[9] = (ImageButton) findViewById(R.id.imageButton10);

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com