9-patch drawable behaving badly, weird artefacts - what is wrong here?

守給你的承諾、 提交于 2019-12-01 10:47:54

Make it small as possible. 9-patch cant shrink they can stretch. Fill right and bottom border with black color. Edit 9-patch borders with draw9patch tool to prevent errors. Your 9-patch should look similar to this one.

Try to do 9-patch markings from all 4 sides. Also make sure you have .9.png file extension (f.i. your_cool_pic.9.png)

Here is my example

The 1 pixel border must be either completely black (nine patch markers) or completely transparent. Basically, edit the image to cut out anything in the 1 pixel border except for the two black dots.

Also, your image can be much, much smaller in size. The point of a nine patch is that the markers on the top and left sides mark what is to be stretched. Most of that content with straight edges could be removed.

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