tags:

views:

95

answers:

4

The problem with NinePatchDrawable. Created 9.png file using a utility draw9patch, but when the throw the file in a folder res/drawable error: No resource found that matches the given name.

A: 

what is the file named? Resource file names can only have lowercase letters, numbers, and underscores with no spaces.

QRohlf
Original file: test.png, the second file: test.9.png. They are in a folder res/drawable. Version SDK 1.6. This can cause the error?
No, those look good. Where exactly are you getting that error?
QRohlf
A: 

Did you add the .png to the file name?

android:drawable="@drawable/9"

will work but

android:drawable="@drawable/9.png"

will NOT work

Aurora
Original file: test.png, the second file: test.9.png.
A: 

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.

Sephy
A: 

The problem was in SDK 1.6. Thank you all for that help.