在Blackberry上设置应用程序的背景图像的最简单方法是什么?

时间:2011-04-11 09:29:48

标签: blackberry background-image

我知道,之前曾问过这个问题。但是我无法相信这次行动如此困难。我想我错过了开发Blackberry应用程序的一些重要观点。

1 个答案:

答案 0 :(得分:0)

尝试使用以下代码:

Bitmap backgroundBitmap = Bitmap.getBitmapResource("background.png");

HorizontalFieldManager horizontalFieldManager = new
HorizontalFieldManager(HorizontalFieldManager.USE_ALL_WIDTH |
HorizontalFieldManager.USE_ALL_HEIGHT){

//Override the paint method to draw the background image.
public void paint(Graphics graphics)
{

//Draw the background image and then call super.paint
//to paint the rest of the screen.
graphics.drawBitmap(0, 0, Display.getWidth(), Display.getHeight(),
backgroundBitmap, 0, 0);
super.paint(graphics);
}
};