Search code examples
androidbackgroundtextviewnine-patch

Android 9-patch doesn't work


Following is the picture, I rename it as ABC.9.png, and open it with Android Studio 9-patch tools. Change it and select the area as extended area, everything works fine. And after that, since Android doesn't accept .9.png format, I change it back to ABC.png. But when I use it as background of textview and set textview wrap_content, nothing happens, the size of textview is still based on ABC.png instead of area of textview. Can anyone help me with this? Thank you very much!!

enter image description here


Solution

  • For better viewing, I am going to copy paste my comment here to the answer section :

    Android accepts that format, you might have the old file which has the same name still in the project. This is a sample of how I named one of my 9patches bubblechat_left_complaint_white_patch.9.png