开发者

Set no scroll on Blackberry MainScreen

Hi i have developed Simple MainScreen in Blackberry also set it on Background image and button but when i move track pad all form are scroll i want stop scroll main screen. following main main screen code.

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"));
    vfmp开发者_开发技巧ass.add(new ButtonField("Button two"));
    hfmPass.add(vfmpass);
    vfm.add(hfmPass);
    add(vfm);
}


In your class constructor, insert:

public MyClass {   
  super(NO_VERTICAL_SCROLL);
}

This will make your screen not scroll. Then, if you want only a VerticalFieldManager to scroll, just set it as scrollable.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜