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

后端 未结 3 1235
天涯浪人
天涯浪人 2021-01-15 08:21

so Im trying out the 9-patch images. I started out with a PNG-file where I have a semi-transparent square with rounded corners:

3条回答
  •  轮回少年
    2021-01-15 08:50

    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.

提交回复
热议问题