在黑莓中创建弹出屏幕

发布于 2024-12-12 07:21:53 字数 215 浏览 2 评论 0原文

我想在 BlackBerry 中创建一个弹出屏幕,就像长按时出现的屏幕一样(参见图片)在此处输入图像描述

我的屏幕包含 3 个项目

图像描述


图像描述


图像描述

任何人都可以通过示例或链接帮助我执行此弹出窗口吗?

I want to create a popup screen in BlackBerry like the screen appear on long click (see the picture)enter image description here

My screen contain 3 items

image description


image description


image description

Can any one help me by an example or link to do this popup?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

断肠人 2024-12-19 07:21:53

使用下面的代码并在您想要显示弹出屏幕的任何地方调用 GetPopup

    final class Getpopup extends PopupScreen
    {
      EditField edf;
     AutoTextEditField edf1;
     HorizontalFieldManager hfm;
     public Getpopup()
    {
    super( new VerticalFieldManager());
    LabelField lf = new LabelField("Contact Info", LabelField.FIELD_HCENTER);
    SeparatorField sf = new SeparatorField(); 
    edf1= new AutoTextEditField("Name:","" ,20,EditField.NO_NEWLINE);        
    edf  = new EditField("Number:",ThirdScreen.get3);
    edf.setEditable(false);  
    VerticalFieldManager vfm =new VerticalFieldManager(VerticalFieldManager.FIELD_HCENTER);
    hfm=new HorizontalFieldManager(HorizontalFieldManager.FIELD_HCENTER);  
    ButtonField bf1 = new ButtonField("Save", ButtonField.FIELD_HCENTER);
    ButtonField bf2 = new ButtonField("Cancel", ButtonField.FIELD_HCENTER);
    hfm.add(bf1);
    hfm.add(bf2);
    vfm.add(lf);
    vfm.add(sf);
    vfm.add(edf1);
    vfm.add(edf); 
    vfm.add(hfm); 
    add(vfm);  
  }
  }

Use the below code and call the GetPopup wherever you want to show the pop up screen

    final class Getpopup extends PopupScreen
    {
      EditField edf;
     AutoTextEditField edf1;
     HorizontalFieldManager hfm;
     public Getpopup()
    {
    super( new VerticalFieldManager());
    LabelField lf = new LabelField("Contact Info", LabelField.FIELD_HCENTER);
    SeparatorField sf = new SeparatorField(); 
    edf1= new AutoTextEditField("Name:","" ,20,EditField.NO_NEWLINE);        
    edf  = new EditField("Number:",ThirdScreen.get3);
    edf.setEditable(false);  
    VerticalFieldManager vfm =new VerticalFieldManager(VerticalFieldManager.FIELD_HCENTER);
    hfm=new HorizontalFieldManager(HorizontalFieldManager.FIELD_HCENTER);  
    ButtonField bf1 = new ButtonField("Save", ButtonField.FIELD_HCENTER);
    ButtonField bf2 = new ButtonField("Cancel", ButtonField.FIELD_HCENTER);
    hfm.add(bf1);
    hfm.add(bf2);
    vfm.add(lf);
    vfm.add(sf);
    vfm.add(edf1);
    vfm.add(edf); 
    vfm.add(hfm); 
    add(vfm);  
  }
  }
过潦 2024-12-19 07:21:53
  1. 在此处查找代码以创建 creating-borderless-transparent-popup 屏幕黑莓
  2. 如果您需要自定义图像中显示的按钮,请访问custom-image-buttonfield-in-blackberry
  3. 您有使用 GridFieldManager.java 作为您使用过的布局,您也可以自定义自己的布局。
  1. Find the code here to create creating-borderless-transparent-popup screen in blackberry
  2. If your looking for custmizing the Buttons as appeared in image then visit custom-image-buttonfield-in-blackberry
  3. You have to make use of GridFieldManager.java for the layout you have used, Also you can customize your own layout.
箜明 2024-12-19 07:21:53

创建一个扩展 Dialog 的 PopupDialog 类,然后在构造函数中添加按钮。如果您希望按钮看起来像上图所示,请扩展字段或按钮字段,然后在绘制方法中绘制按钮,然后绘制按钮下方的按钮文本。在 PopupDialog 中添加此自定义按钮控件。

Create a PopupDialog class which extends Dialog and then in the constructor, add the Buttons. If you would like your buttons to look like the above image, extend a field or button field and in paint method, draw the button and then the button text below the button. Add this custom button control in the PopupDialog.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文