color value drawable resource issue

断了今生、忘了曾经 提交于 2019-12-04 01:52:54

Remove the '-' in the file name.

NOTE: '-' is not a valid file-based resource name character: File-based resource names must contain only lowercase a-z, 0-9, or underscore

As mentioned by android doc jpg is not supported. Use png instead:

A drawable to use as the background. This can be either a reference to a full drawable resource (such as a PNG image, 9-patch, XML state list description, etc), or a solid color such as "#ff000000" (black).

Some people have mentioned restarting Eclipse has worked, but that didn’t work for me.

Instead, I found that I had to simply rename the image file so that it did NOT start with a number. All icons in the Android Developer Icon Pack start with a number, and I had just copied the one over. It appears that if the file starts with a number, it is assumed to be the start of a hexadecimal color value, and hence looks for the # symbol.

working with: Eclipse Juno 3.7.2, Android SDK 21.1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!