Android的工作室的mipmap和9个补丁可绘 [英] Android studio mipmap and 9-patch drawables
问题描述
我面对奇怪的问题试图把9补丁可绘制成新的Android工作室的mipmap目录。我已经把所有的图像到指定的文件夹,就像我用绘做的,但是当我试图把它列入一个项目它说:
I am facing strange issue trying to put 9 patch drawables into new android studio mipmap directories. I've put all the images to specified folders, just as I used to do with drawable, but when I try to include it in a project it says
无法解析符号@的mipmap / MYFILE
Cannot resolve symbol @mipmap/myfile
但它绝对发现它,你可以在截图中看到。
but it definitely "finds" it as you can see at the screenshot.
我觉得不能解析符号,因为真正的文件名有.9点,但不能定义绘制使用。 (我试过了,没有工作:))
I think it cannot resolve the symbol because the "real" filename has .9, but dots cannot be used in defining drawable. ( I tried, it didn't work :) )
时有人esle面临着同样的问题?目前,我已经添加了可绘制文件夹和定义的所有Eclipse的风格,它是工作,但它是解决问题的丑陋的方式。谢谢你。
Is someone esle is facing same problem? Currently, I've added the drawables folders and defined everything eclipse-style and it is working, but It is ugly way to resolve the problem. Thank you.
推荐答案
您必须的添加所有9补丁图像可绘制文件夹,并通过引用的 @绘制/ your_image_name 使用STRONG>
You must add all your 9-patch images to drawable folder and use it by referencing @drawable/your_image_name.
有关更多信息,请参阅的 Android开发者博客
For more information refer Android Developers Blog
这篇关于Android的工作室的mipmap和9个补丁可绘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!