android studio 不支持 .9图片?

开始转到studio上的时候,一直以为这是版本更新后bug,把.9图片从新做了几次都没有解决问题,后来看官网介绍,这个.9图片是必须要放在res/drawable/这个目录下的,不然会导致无法编译.

下面是官网关于.9图片介绍:

NinePatchDrawable graphic is a stretchable bitmap image, which Android will automatically resize to accommodate the contents of the View in which you have placed it as the background. An example use of a NinePatch is the backgrounds used by standard Android buttons — buttons must stretch to accommodate strings of various lengths. A NinePatch drawable is a standard PNG image that includes an extra 1-pixel-wide border. It must be saved with the extension .9.png, and saved into the res/drawable/ directory of your project.


有道翻译:一个 NinePatchDrawable 图形是一种可伸缩的位图 形象,安卓 将自动调整,以适应视图的内容你有什么 把它作为背景。 一个例子使用NinePatch标准Android按钮-使用的背景 按钮必须伸展以适应各种长度的字符串。 一个NinePatch可拉的是A 标准PNG 映像,其中包含一个额外的1像素宽的边界。 它必须保存扩展 .9.png , 并保存到res /drawable你的项目目录。


版权声明:本文为jiuhaofangyinyue原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。