我一直致力于在应用程序中获取背景图像,并在屏幕底部为图像排列四个按钮。 下面我显示了我用来实现它的代码。 HorizontalFieldManager manager = new HorizontalFieldManager();在黑莓背景屏幕底部放置按钮
manager.add(new ButtonField("1", FIELD_BOTTOM));
manager.add(new ButtonField("2", FIELD_BOTTOM));
manager.add(new ButtonField("3", FIELD_BOTTOM));
manager.add(new ButtonField("4", FIELD_BOTTOM));
mWidth = Display.getWidth();
mHeight = Display.getHeight();
final Bitmap backgroundBitmap = Bitmap.getBitmapResource("intro.png");
HorizontalFieldManager BackGroundImage = 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, mWidth, mHeight,backgroundBitmap, 0, 0);
super.paint(graphics);
}
};
BackGroundImage.add(manager);
add(BackGroundImage);
的事情是,现在我不能够把这些按钮在屏幕的底部,如果我把一个Field_BOTTOM是horizontalFieldManager。
我很欣赏的帮助在这方面.. 谢谢
你试过了'VerticalManager' – BBdev
是的,我已经试过垂直和水平经理,我都面临同样的问题... – alanvabraham