0

BlackBerryでは、サイズ480X360の画像を背景に表示する画面を開発しました。私のBB画面のサイズは480X360です。垂直方向にスクロールすると画像のサイズが少し大きくなるため、画面がスクロールされて画面が乱れます。

縦スクロールができないようにスクロールをロックしたい。

私のコードは次のとおりです。

public LaunchXtcMsngrScreen()
{
    int intwidth = Display.getWidth();
    int intheight = Display.getHeight();


    //getting the height/width of BB screen
    Debugger.debug(UrlInfo.workflow_File,"Screen Height ="+intheight);
    Debugger.debug(UrlInfo.workflow_File,"Screen Width ="+intwidth);

    BMbackground = Bitmap.getBitmapResource("xtclogo.jpg");

    VerticalFieldManager VFM = new VerticalFieldManager(VerticalFieldManager.USE_ALL_WIDTH 
                                                                | VerticalFieldManager.USE_ALL_HEIGHT
                                                                | VerticalFieldManager.NO_VERTICAL_SCROLL
                                                                | VerticalFieldManager.NO_VERTICAL_SCROLLBAR)
    {
        //Override the paint method to draw the background image.
        public void paint(Graphics graphics)
        {   
            //Draw the XTC Messenger logo
            graphics.drawBitmap(0, 0,Display.getWidth(),Display.getHeight(),BMbackground, 0, 0);
            super.paint(graphics);
        }
    };

    Bitmap registerbitmap = Bitmap.getBitmapResource("register_button.PNG");
    BFregister = new ImageButtonField(registerbitmap);

    BFregister.setMargin(245,0,0,190);//vertical pos,0,0,horizontal pos

    VFM.add(BFregister);
    add(VFM);

}
4

2 に答える 2

7

関数宣言の次の行として以下のコードを追加します

super(NO_VERTICAL_SCROLL | NO_VERTICAL_SCROLLBAR);

于 2011-01-13T12:43:38.380 に答える
1

あなたがマネージャーの中にあなたのイメージを置いたならば、あなたはどんな考えに従うことができますか?

1)カスタムマネージャーを作成し、そのサブレイアウトメソッドにsetExtent(480,360)を書き込みます。2)任意のHorizo​​ntalfieldManagerまたはVerticalFieldManagerのサブレイアウトメソッドでsetExtent(480,360)を書き込むこともできます

マネージャーでUSE_ALL_WIDTHとUSE_ALL_HEIGHTを使用してみましたか?

于 2011-01-13T10:20:39.993 に答える