How can I set imageView border from 9 patch file in assets folder? I have tried this but didn't work.
Drawable d = Drawable.createFromStream(getAssets().open("borders/border1.9.png"), null);
imageView.setBackground(d);
Any idea?
How can I set imageView border from 9 patch file in assets folder? I have tried this but didn't work.
Drawable d = Drawable.createFromStream(getAssets().open("borders/border1.9.png"), null);
imageView.setBackground(d);
Any idea?
9-Patch PNGs are compiled on build time.
Non compiled .9.PNG is a usual PNG and is loaded as is.
The build.xml describes the task to compile .9.pngs to the AAPT (Android Asset Packaging Tool).
You can't compile it on runtime, put you can precompile them with aapt:
Where: 'output-folder' has to exist