android 把bitmap转成drawble后宽高不一致的解决方法

 DisplayMetrics metrics = new DisplayMetrics();
 this.getWindowManager().getDefaultDisplay().getMetrics(metrics);
 Resources r = new Resources(this.getAssets(), metrics, null);
 Drawable bgDrawble2 = new BitmapDrawable(r, bgBitmap);

你可能感兴趣的:(android,null,resources)