如何在BlackBerry中使主屏幕透明?

时间:2012-09-25 12:19:23

标签: user-interface blackberry java-me

我想创建一个应用程序,我想在某些事件发生时获取对话框。我能够得到对话,但背后我得到一个白色的屏幕。我不想要那个屏幕。有没有办法让这个屏幕透明?

public final class LoadingPopupScreen extends PopupScreen
{
    Background  background;
    HorizontalFieldManager hfm;
    int width;
    int height;
    public LoadingPopupScreen( int width, int height)
    {  
        super(new VerticalFieldManager());
        background = BackgroundFactory.createLinearGradientBackground(Color.ROYALBLUE, Color.BLACK, Color.ROYALBLUE, Color.BLACK);
        setBackground(background);
        add(new LabelField("ROAMING"));
        add(new SeparatorField());
        add(new SeparatorField());
        hfm = new HorizontalFieldManager();
        Bitmap bitmap = Bitmap.getBitmapResource("splash.png");
        BitmapField  bit= new BitmapField(bitmap);
        hfm.add(bit);
        hfm.add(new LabelField("want to check In Roaming or not?"));
        add(hfm);
        hfm = new HorizontalFieldManager(Manager.FIELD_HCENTER);
        ButtonField ok = new ButtonField("OK", HorizontalFieldManager.FIELD_HCENTER);
        ButtonField cancel = new ButtonField("CANCEL", HorizontalFieldManager.FIELD_HCENTER);
        hfm.add(ok);
        hfm.add(cancel);
        add(hfm);
    }
}

1 个答案:

答案 0 :(得分:0)

我用它完成了:

Ui.getUiEngine().pushGlobalScreen(new LoadingPopupScreen(300,300), 0, UiEngine.GLOBAL_QUEUE);