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

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -