问题描述
我用AssetManager然后我在文件夹资产/ testAssets / img1.jpg,... img50.jpg名称的图像阵列。在这里,code:
最后AssetManager ASMR = getAssets();
的String [] =文件列表asmr.list(testAssets);
我需要从阵列得到所有ID图片使用此code其他1功能:
`可绘制D = getResources()getDrawable(图像的ID有索引i);`
我能获得ID用绘制对象?!如果我不能,我可以用任何东西来使用绘制对象,我必须用可绘做我的应用程序! TKS这么多....
可绘制D = Drawable.createFromStream(getAssets()。打开(文件夹/ my_image.png),NULL) ;
I use AssetManager then i have array of name images in folder "assets/testAssets/img1.jpg,...img50.jpg". Here code:
final AssetManager asmr = getAssets(); String[] filelist = asmr.list("testAssets");
I need get all ID images from that array to use this code from 1 other function:
`Drawable d = getResources().getDrawable(ID of image have index i);`
Can i get ID to use "Drawable" ?! If i can't, can i use any thing to use "Drawable", i must use "Drawable" to do my application! Tks so much....
Drawable d = Drawable.createFromStream(getAssets().open("folder/my_image.png"), null);
这篇关于如何在有资产的文件夹名称图像阵列获得ID图像阵列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!