set bitmap to background of ImageView with imageView.setImageBitmap method

前端 未结 6 1028
野趣味
野趣味 2021-01-31 15:16

I have an ImageView. I am using imageView.setImageBitmap to set my image as background to ImageView. But it sets my image to ImageVi

6条回答
  •  萌比男神i
    2021-01-31 16:05

    try this..

    Create drawable using bitmap & use setBackgroundDrawable(Drawable d) method for imageview.

    Drawable d = new BitmapDrawable(getResources(),bitmap);
    
    imageview.setBackgroundDrawable(d);
    

提交回复
热议问题