Working 9-patch images from assets ( or any other location )
Using 9-patch images is a great way to quickly create nice application UI.
However, (uncrunched) 9-patch images created with draw9patch tool will not work if you try to load them from assets or any other internal or external location. You have to put them in one of resources drawable directory.
To solve this issue you have to run this command ( output directory have to be created earlier ):
aapt c -S /dir_with_uncrunched_9patch/ -C ./output_dir/
Now you have crunched version of your 9-patch images, you may keep them, and use them, anywhere you want.
Written by Iwo Polański
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Android
Authors
Related Tags
#android
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#