Android中向drawable图片资源命名须知

来源:互联网 发布:c语言编写安卓 编辑:程序博客网 时间:2024/05/16 00:48

今天在文件浏览器中需要添加几张图片,在添加资源后总是报错,非常郁闷。重命名图片时才明白报错红色字体的意思,即图片资源命名时必须仅仅包含小写字母,0~9和_,贴出来希望大家引以为戒。

<code class=" hljs applescript" style="box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; padding: 0.5em; color: rgb(0, 0, 0); border-radius: 0px; display: block; background-image: initial; background-attachment: initial; background-color: transparent !important; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;">[<span class="hljs-number" style="box-sizing: border-box; color: rgb(0, 136, 0);">2015</span>-<span class="hljs-number" style="box-sizing: border-box; color: rgb(0, 136, 0);">02</span>-<span class="hljs-number" style="box-sizing: border-box; color: rgb(0, 136, 0);">21</span> <span class="hljs-number" style="box-sizing: border-box; color: rgb(0, 136, 0);">15</span>:<span class="hljs-number" style="box-sizing: border-box; color: rgb(0, 136, 0);">58</span>:<span class="hljs-number" style="box-sizing: border-box; color: rgb(0, 136, 0);">41</span> - FileTestExplorer] res\drawable-hdpi\myFolder.png: Invalid <span class="hljs-type" style="box-sizing: border-box;">file</span> <span class="hljs-property" style="box-sizing: border-box;">name</span>: must <span class="hljs-keyword" style="box-sizing: border-box; font-weight: bold;">contain</span> only [a-z0-<span class="hljs-number" style="box-sizing: border-box; color: rgb(0, 136, 0);">9</span>_.]</code>

这里写图片描述
这里写图片描述

0 0
原创粉丝点击