android-图像大小调整停止工作-可缩放、可设置复合绘图功能SwithinInstincBounds

android-图像大小调整停止工作-可缩放、可设置复合绘图功能SwithinInstincBounds,android,textview,android-drawable,android-bitmap,Android,Textview,Android Drawable,Android Bitmap,我有以下代码来调整图像大小: int size = `textView.getLineHeight()`; Drawable drawable = caller.getResources().getDrawable(R.drawable.myDrawable); drawable = new ScaleDrawable(drawable, 0, size, size).getDrawable(); drawable.setBounds(0, 0, size, size); textView.s

我有以下代码来调整图像大小:

int size = `textView.getLineHeight()`;
Drawable drawable =  caller.getResources().getDrawable(R.drawable.myDrawable);
drawable = new ScaleDrawable(drawable, 0, size, size).getDrawable();
drawable.setBounds(0, 0, size, size);
textView.setCompoundDrawablesWithIntrinsicBounds(drawable, 0, 0, 0);
该代码工作正常,突然停止。图像没有调整大小,而是以全尺寸显示。我甚至不知道是什么原因造成的。我99.99%确定我没有更改代码中的任何内容。然而,我重新组织了一点我的绘图文件夹。或者它与eclipse定期自动加载的某些文件有关

总结如何调整图像大小以使其等于textView.GetLineHeights请注意,在我的情况下,使用两个视图ImageView和textView并不是一个好的解决方案,因此我更愿意关注如何调整位图本身的大小