Android - 9 patch

点点圈 提交于 2019-12-12 14:38:48

问题


I'm trying to create a new spinner background using a 9 patch picture. I've tried many ways to get a perfect image but I failed :s

Here is my 9 patch:

The content looks to be good when I simulate with Draw-9-patch but the part with the arrow is not displayed, or when it is, this part is totally mal-formed.

I've put the top black line to the whole size and the problem is still the same.

Do you know how to solve it?

Thanks.

Regards.

V.


回答1:


First of all, you've marked your rounded corners as stretchable, this should be avoided so your corners stay the same, no matter how its stretched. You've also marked your arrow as being stretchable vertically, which I suppose is not desirable.

See the attached image for a fixed 9-patch (note the differences in 9-patch frame compared to your image), this should scale well in all directions.



来源:https://stackoverflow.com/questions/10006633/android-9-patch

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