看板 [ java ]
討論串[問題] Android 用for迴圈寫findViewById
共 2 篇文章
首頁
上一頁
1
下一頁
尾頁

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者jinmin88 (晝伏夜出)時間10年前 (2014/11/08 20:21), 編輯資訊
0
0
1
內容預覽:
假設要抓R.id.button1. Class<?> rClass = R.id.class;. Field f = rClass.getField("button1");. f.setAccessible(true);. Log.d("debug","field="+f.getName()+",

推噓3(3推 0噓 5→)留言8則,0人參與, 最新作者v3dys6f3a3j5 (藍氣)時間10年前 (2014/10/12 20:32), 10年前編輯資訊
0
0
1
內容預覽:
我的程式裡面有13個Button,我想問可不可以用for的迴圈寫出. button1=(Button)findViewById(R.id.button1);. .. .. .. button13=(Button)findViewById(R.id.button13);. 給你們看一下我寫的錯誤程式.
(還有556個字)
首頁
上一頁
1
下一頁
尾頁