對於我的android應用程序,我需要製作一個View
ID的數組。你如何循環查看ID的?
該數組將保存81個值,因此將它們逐個添加非常冗長。 這是現在的樣子:
cells[0] = R.id.Square00;
cells[1] = R.id.Square01;
cells[2] = R.id.Square02;
cells[3] = R.id.Square03;
cells[4] = R.id.Square04;
cells[5] = R.id.Square05;
//All the way to 80.
是否有這樣做的一個較短/更有效的方式?
很多方面EED ..你可以用'SETID()'和'的getId()'動態代碼中的或有'getIndentifier()'從**資源的方法**班。 – user370305