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

透过资源文件名获得资源ID

2012-06-27 
通过资源文件名获得资源IDint resID getResources().getIdentifier(org.loveandroid.androidtest:drawa

通过资源文件名获得资源ID

int resID = getResources().getIdentifier("org.loveandroid.androidtest:drawable/gallery_photo_1",null,null);

热点排行