为什么在ImageView Android中使用ImageDrawable属性图像大小非常短?

时间:2014-07-13 07:25:18

标签: android android-imageview android-animation android-drawable

我使用ImageDrawable在ImageView Widget中显示图像,但是这个图像很短。 当我使用ImageResource属性大小没关系时

我的代码 ImageResource:

imageview.setImageResource(R.drawable.a1);

我的代码 ImageDrawable:

imageview.setImageDrawable(R.drawable.a1);

任何帮助将不胜感激。感谢

1 个答案:

答案 0 :(得分:1)

您可以使用Background Drawable for ImageView

imageview.setBackgroundDrawable(R.drawable.a1);