做sdk时不能使用res文件下的图片资源,只能放在assets中,这时布局中要使用9.png格式的图片就成了大问题。
先参考:关于.9.png图片生成问题中提到的问题。可以得知是bit.getNinePatchChunk()会为null。
然后我又找到了下面这篇文章:
/*----------------*/
getNinePatchChunk
works just fine. It returned null because you were givingBitmap
a "source" ninepatch. It needs a "compiled" ninepatch image.There are two types of ninepatch file