最近,我听说过的9片图像。我知道它的9瓷砖和可拉伸。我想多了解一下。
I recently heard about 9-patch images. I know its 9 tiled and is stretchable. I'd like to know more about it.
如何创建一个9片图像?
How can I create a 9-patch image?
有没有什么工具?我可以从AndroidSDK或code创建它?
Is there any tool? Can I create it from AndroidSDK or code?
9修补过正规PNG的主要优点?
Main Advantages of 9-patch over regular png?
(它是拉伸动态/自动根据画面?)
(is it stretchable dynamically/ automatically according to screen?)
今天,我发现了9片图像。在其他的答案链接到的文件就可以了,我想,但他们真正缺乏的例子。 这个小教程有在最后的回答你的问题的第二部分,一些伟大的例子,解释了如何定标工作 - 不只是按钮 - 而且帧。这九个补丁可以指定非连续的区域规模。
Today I discovered nine patch images. The documentation linked to in the other answers is ok I suppose, but they really lack in examples. This little tutorial has some great examples at the end that answer the second part of your question, explaining how the scaling works - not just for buttons - but also frames. The nine patch can specify non-contiguous areas to scale.
只是为了充实的回答你的问题,该SDK附带了draw9patch(Tools文件夹中),这是一个简单的编辑器的第一部分。 这里是另一个下载其中一个是好的,它有一个简单而巧妙的默认图像。
Just to flesh out the the answers to the first part of your question, the SDK ships with "draw9patch" (in the tools folder) which is a simple editor. Here is another downloadable one which is good, and it has a simple but clever default image.