-2

我想将白色背景屏幕添加到我的黑莓屏幕(即主屏幕)之后,我可以在屏幕上绘制一些东西。如何创建背景以及如何在该屏幕上绘图。请建议我。请把示例代码发给我……我已经写了这段代码,但它不起作用……

Background bg = 
BackgroundFactory.createBitmapBackground(
    Bitmap.getBitmapResource("/Background.png"));
setBackground(bg);
VerticalFieldManager verticalFieldManager = new VerticalFieldManager();


 add(verticalFieldManager);
4

1 回答 1

1

尝试这个..

final Bitmap backgroundBitmap = Bitmap.getBitmapResource("blackbg.png");

VerticalFieldManager mainManager = new VerticalFieldManager(Manager.NO_VERTICAL_SCROLL | Manager.NO_VERTICAL_SCROLLBAR )
{ 
public void paint(Graphics graphics)
{
graphics.clear();
graphics.drawBitmap(0, 0, deviceWidth, deviceHeight, backgroundBitmap, 0, 0); 
super.paint(graphics);
} 
};
于 2012-05-14T10:07:19.483 回答