0
我试图在ImageView中设置drawable,我可以通过intrinsicWidth和height 160的图像位图绘制图像,并且imageview宽度为36dp,但静止图像未在36dp imageview中设置。 图像看起来比imageview更小。ImageDrawable未设置在欲望imageview大小
请帮帮我。
<ImageView
android:id="@+id/img_doctor"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_centerVertical="true"
android:scaleType="centerCrop" />
Drawable drawable11 = new BitmapDrawable(getResources(),myBitmap);
Log.e("", ""+drawable11.getIntrinsicWidth()+"::"+drawable11.getIntrinsicHeight());
imgView.setImageDrawable(drawable11);
这里我得到160 :: 160在logcat。
实际上,我创建的这个位图绘制的圆形图像,所以我不能直接使用哥们。 –