黑莓中的按钮
答
您需要有一个现场管理器来覆盖整个屏幕。并且在该管理器的绘制方法中,您需要绘制整个屏幕大小的背景图像,然后调用super.Paint()
之后,您可以在同一个管理器上添加两个按钮。
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);
}
};
现在潘内尔
你尝试过什么到目前为止添加按钮? (随意发布一些代码示例。)你卡在哪里? – 2010-12-15 13:10:40
您定位哪个BB OS?我问,因为使用4.6或更高版本创建背景更容易。另外,您是否知道如何将侦听器添加到按钮或创建它们? – Jonathan 2010-12-15 15:52:12