Why does patch 9 not work at all in my application?

I am currently trying to use 9 patch pictures in my application.

The image is pretty clear and works well in a graphical tool with an SDK:

The image looks like this:

enter image description here

and the tool works fine:

enter image description here

Unfortunately, with such a simple layout, rendering is poor on the device, and the 9-patch doesn't work at all:

<TextView android:id="@+id/platenumber" android:background="@drawable/plate_fr" android:layout_width="320dip" android:layout_height="wrap_content" /> 

Any idea what I'm doing wrong?

enter image description here

EDIT:

My photo is called * .9.png

enter image description here

+4
source share
3 answers

The black lines should be completely black (RGB: # 000000), and the transparent area around the black lines should be completely transparent.

+11
source

The extension of your image with 9 patches should end with .9.png or it will be accepted as a normal image

+5
source

Check if you have at least one black pixel on all four sides of your images.

+3
source

Source: https://habr.com/ru/post/1415965/


All Articles