android - set 9 patch from assets folder -
how can set imageview border 9 patch file in assets folder? have tried didn't work.
drawable d = drawable.createfromstream(getassets().open("borders/border1.9.png"), null); imageview.setbackground(d);
any idea?
9-patch pngs compiled on build time.
non compiled .9.png usual png , loaded is.
the build.xml describes task compile .9.pngs aapt (android asset packaging tool).
you can't compile on runtime, put can precompile them aapt:
aapt.exe c -s <input-folder-with-images> -c <outpout-folder>
where: 'output-folder' has exist
Comments
Post a Comment