开发者

Install icons from android asset studio

开发者 https://www.devze.com 2023-04-04 21:19 出处:网络
I need to install tab icons from Android asset studio. The downloaded zip contains a res folder with another folders: drawable, dra开发者_JS百科wable-hdpi, etc. I\'ve copied the files from the res/dra

I need to install tab icons from Android asset studio. The downloaded zip contains a res folder with another folders: drawable, dra开发者_JS百科wable-hdpi, etc. I've copied the files from the res/drawable in the downloaded zip, into the res/drawable folder and I've done the same with hdpi, ldpi and mdpi.

Then I used the code:

   firstTabSpec.setIndicator("tabname",getResources().getDrawable(R.drawable.ic_tab_myicon));

But the app does not run because there is no icon. My icon does not appear in the list, however, does appear ic_menu_camera and others android icons.

The code works fine with other icons like “ic_menu_camera”.

Could someone help me?

Thank you!


It sounds like you're importing android.R rather than your project's resources. Can you check your import statements, and remove android.R if it appears?

If that doesn't fix the problem, can you provide more details? The code snippet you provided looks potentially fine, but to help you out, we'd need to see more about your asset layout, filenames, etc.

0

精彩评论

暂无评论...
验证码 换一张
取 消