黑莓对话框的背景颜色 [英] Dialog box background color on Blackberry

查看:125
本文介绍了黑莓对话框的背景颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的申请,我自动显示警告,如果GPS定位无效:

In my application, I show alert if the GPS location invalid:

Dialog.alert(不能在当前位置信息。);

我想改变对话框警报的默认背景色和文本颜色。我需要透明银色。如何在黑莓手机创建一个自定义对话框警告?

I want to change the default background color and text color of the dialog alert. I need transparent silver color. How to create a custom dialog alert on Blackberry?

推荐答案

要显示定制对话框需要通过扩展PopupScreen创建自定义类。

To show custom dialog you need to create custom class by extending PopupScreen.

像下面。

class CustomPopUp extends PopupScreen
{

    public CustomPopUp(Manager delegate)
    {
        super(delegate);
    }
}

创建自定义类之后,你需要采取管理等。

After creating custom class you need to take Manager like.

 VerticalFieldManager pop=new VerticalFieldManager();
 pop.setBackground(BackgroundFactory.createSolidBackground(Color.BLUE));
 LabelField lf=new LabelField("Invalid Location");
 ButtonField btn=new ButtonField("OK",DrawStyle.HCENTER);
 pop.add(lf);
 pop.add(btn);

按下Screen当你要像下面显示的对话框。

Push Screen when you want to display dialog like below.

UiApplication.getUiApplication().pushScreen(pop);

在按钮单击监听通话

 UiApplication.getUiApplication().popScreen(pop);

希望这会帮助你。

Hope This will help you

这篇关于黑莓对话框的背景颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆