您好我已经在Blackberry中开发了Simple MainScreen也将它设置在背景图像和按钮上但是当我移动音轨垫所有形式都滚动我想要停止滚动主屏幕。以下主要主屏幕代码。
Bitmap bitBg;
public ButtonDemo() {
super();
bitBg = Bitmap.getBitmapResource("background.png");
VerticalFieldManager vfm = new VerticalFieldManager(
VerticalFieldManager.USE_ALL_HEIGHT
| VerticalFieldManager.USE_ALL_WIDTH) {
public void paint (Graphics g){
g.drawBitmap(
0, 0,
Graphics.getScreenWidth(), Graphics.getScreenHeight(),
bitBg,
0, 0
);
super.paint(g);
}
};
HorizontalFieldManager hfmPass =
new HorizontalFieldManager(HorizontalFieldManager.FIELD_HCENTER);
VerticalFieldManager vfmpass =
new VerticalFieldManager(VerticalFieldManager.NO_HORIZONTAL_SCROLLBAR);
vfmpass.add(new ButtonField("Button One"));
vfmpass.add(new ButtonField("Button two"));
hfmPass.add(vfmpass);
vfm.add(hfmPass);
add(vfm);
}
答案 0 :(得分:2)
在类构造函数中,插入:
public MyClass {
super(NO_VERTICAL_SCROLL);
}
这会使您的屏幕无法滚动。然后,如果您只想滚动VerticalFieldManager,只需将其设置为可滚动。