0

我正在寻找黑莓中的自定义管理器,它连续使用 5 个不同的字段。所有字段都应该是交互式的。我已经粘贴了我希望使用 blackberry 5.0 SDK 实现的图像。请帮助开始

在此处输入图像描述

4

1 回答 1

0

我试过这样的东西 -在此处输入图像描述

试试下面的代码 -

    import net.rim.device.api.system.Bitmap;
    import net.rim.device.api.ui.component.BitmapField;
    import net.rim.device.api.ui.component.ButtonField;
    import net.rim.device.api.ui.component.LabelField;
    import net.rim.device.api.ui.container.HorizontalFieldManager;
    import net.rim.device.api.ui.container.MainScreen;
    import net.rim.device.api.ui.container.VerticalFieldManager;


public class scree_align extends MainScreen{

public scree_align(){

    HorizontalFieldManager hfm_main=new HorizontalFieldManager();/*{
         protected void sublayout(int maxWidth, int maxHeight) 
          { 
              super.sublayout(Display.getWidth(),200); setExtent(Display.getWidth(),200);
          }
      };*/

    HorizontalFieldManager hfm_1=new HorizontalFieldManager();
    final Bitmap back = Bitmap.getBitmapResource("image.png");
    hfm_1.add(new BitmapField(back));
    hfm_1.setMargin(5,5,0,0);

    VerticalFieldManager vfm_1=new VerticalFieldManager();
    ButtonField btn1=new ButtonField("Button1");
    ButtonField btn2=new ButtonField("Button1");
    vfm_1.add(btn1);
    vfm_1.add(btn2);


    VerticalFieldManager vfm_2=new VerticalFieldManager();
    ButtonField btn3=new ButtonField("Button2");
    ButtonField btn4=new ButtonField("Button2");
    vfm_2.add(btn3);
    vfm_2.add(btn4);


    HorizontalFieldManager hfm_2=new HorizontalFieldManager();
    LabelField lab=new LabelField("Text");
    hfm_2.add(lab);
    hfm_2.setMargin(30,0,0,5);

    hfm_main.add(hfm_1);
    hfm_main.add(vfm_1);
    hfm_main.add(vfm_2);
    hfm_main.add(hfm_2);

    add(hfm_main);

}

}
于 2012-05-09T10:29:19.847 回答