开发者

Buttons In Blackberry

I want to create a screen in which there is an image in the background and in the foreground there are two centered buttons. When either of the开发者_JAVA百科 buttons are clicked, I want to display new screens.

I am able to create the buttons only -- the rest I am unable to complete.


RIM offers an extensive set of Development Guides that are a good start.


You need to have a field manager to cover the entire screen. and in the paint method of that manager you need to draw the background image of entire screen size then call super.Paint()

after that you can add two buttons on the same manager.

final Bitmap bodyBG = Bitmap.getBitmapResource("body"+ApplicationUtil.getInstance().getScreenResolution()+".png");
 VerticalFieldManager pannel = new VerticalFieldManager(VerticalFieldManager.VERTICAL_SCROLL){


protected void sublayout(int maxWidth, int maxHeight) {

// TODO Auto-generated method stub

super.sublayout(Display.getWidth(), Display.getHeight());

setExtent(Display.getWidth(), Display.getHeight());

}

protected void paint(Graphics graphics) {

// TODO Auto-generated method stub

graphics.clear();

graphics.drawBitmap(0,0,bodyBG.getWidth(), bodyBG.getHeight(), bodyBG, 0, 0);

super.paint(graphics);

}

};

now add buttons on pannel

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜