【发布时间】:2010-11-22 05:00:21
【问题描述】:
我希望能够将 xml 文件中的图像按钮的背景设置为用户在手机上拍摄的图片。
我将图片设置为cameraBitmap。
cameraBitmap = (Bitmap) intent.getExtras().get("data");
我想将该图片作为图像按钮的背景。问题是,方法:setBackgroundDrawable() 只能传入一个drawable。如何将该位图更改为可绘制图片并使其成为背景?
我目前有:
private ImageButton theImageButton;
theImageButton.setBackgroundDrawable(cameraBitmap);
【问题讨论】:
标签: android image background drawable imagebutton