【发布时间】:2011-12-11 13:12:43
【问题描述】:
我使用这样的 onDraw 方法显示图像:
public void onDraw(Canvas canvas) {
super.onDraw(canvas);
Bitmap background = BitmapFactory.decodeResource(getResources(), R.drawable.photo0);
canvas.drawColor(Color.BLACK);
canvas.drawBitmap(background, 0, 0, null);
我想将此图像设置为背景,但它只显示在屏幕的一部分上。如何设置为全屏?
有没有办法从 xml 中将图片设置为背景,并通过 onDraw 方法在该图片上绘制其他图片?
【问题讨论】:
标签: android image fullscreen ondraw