我一直致力於在應用程序中獲取背景圖像,並在屏幕底部爲圖像排列四個按鈕。 下面我顯示了我用來實現它的代碼。 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