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

问题描述:

我知道,这个问题之前被问到。不过,我不能相信这次行动太困难了。我想我错过了开发黑莓应用程序的一些重要观点。什么是在黑莓上设置应用程序的背景图像的最简单的方法

尝试使用下面的代码:

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); 
} 
}; 
+0

我acccepted你的答案,但它不适合整个屏幕。 – redline 2011-04-21 08:21:06