Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android What is wrong with this 9 patch?

enter image description here

Hello,

see above for my 9 patch image. It is created using the 9 patch editor from Android tools. I have multiple issues:

  • The nine patch tool in preview scales the image in height as well. Why? Zhere is no black line on the left.
  • The nine patch tool shows bad patches. I think that means that I still can use it but it might not look good. Is there any simpler shape than this? What goes wrong when stretching?
  • I cannot import this 9.png file into my project without errors. So technically there must be something wrong.

Thanks, A.

like image 575
AndyAndroid Avatar asked Mar 09 '11 09:03

AndyAndroid


1 Answers

Seems like both top and left lines are required by 9-patch to determine the stretchable area. You could put one pixel there. You could later fix the height of the view which uses this image to prevent it from stretching in height.

like image 148
denis.solonenko Avatar answered Sep 26 '22 13:09

denis.solonenko