首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

失去id的方法

2012-08-30 
得到id的方法int id getResources().getIdentifier(cell00, id, getPackageName())TextView currce

得到id的方法

int id = getResources().getIdentifier("cell00", "id", getPackageName());TextView currcell = (TextView) findViewById(id); 

Class clazz = R.id.class;Field f = clazz.getField("cell" + "00");int id = f.getInt(null); ?// pass in null, since field is a static field.TextView currcell = (TextView) findViewById(id); 

热点排行