代码中使用9妹子(未验证是否可行)
曾经在网上看过很多关于这方面的资料,实验过都没成功。(不是正常拉伸,就是读取错误。)
if(is==null){
webViewContainer.setBackgroundResource(R.drawable.weibosdk_dialog_bg);
}
else{
Bitmap bitmap = BitmapFactory.decodeStream(is);
NinePatchDrawable npd=new NinePatchDrawable(bitmap, bitmap.getNinePatchChunk(), new Rect(0,0,0,0), null);
webViewContainer.setBackgroundDrawable(npd);
}
目测这种方式依然不成功,因为依然没有解决NinePatchChunk 的问题。
代码截取于新浪微博SDK 中的 WeiboDialog setUpWebView() 方法。
//2013年1月10日

浙公网安备 33010602011771号