Problem with NinePatchDrawable
The problem with NinePatchDrawable. Created 9.png file using a utility draw9开发者_开发技巧patch, but when the throw the file in a folder res/drawable error: No resource found that matches the given name.
what is the file named? Resource file names can only have lowercase letters, numbers, and underscores with no spaces.
Did you add the .png to the file name?
android:drawable="@drawable/9"
will work but
android:drawable="@drawable/9.png"
will NOT work
Your issue is that you can't have test.png and test.9.png in the same folder. You must remove the test.png once you have "9-patched" it. Because for the system, it refers to the same image.
精彩评论