什么是在黑莓上设置应用程序的背景图像的最简单的方法
答
尝试使用下面的代码:
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);
}
};
我acccepted你的答案,但它不适合整个屏幕。 – redline 2011-04-21 08:21:06