【问题标题】:Blackberry Help Aligning this layoutBlackberry 帮助 对齐此布局
【发布时间】:2012-10-13 02:32:54
【问题描述】:

我已经尝试过了,但无法实现。我用 justifiedfieldmanager 只买了 2 个标签。我使用了horizo​​ntalfieldmanager,但它无法像这样对齐。我只是坚持如何在黑莓中获得这种类型的布局!非常感谢任何帮助!

谢谢!!

【问题讨论】:

    标签: layout blackberry blackberry-jde


    【解决方案1】:

    有几种方法可以实现这一点,我建议您使用 AbsoluteFieldManager

    //--------this is your toolbar AbsoluteFieldManager
    AbsoluteFieldManager    _fieldManagerBottom;
    _fieldManagerBottom = new AbsoluteFieldManager(); 
    ////------------

    ///--在这里将背景图像添加到工具栏 BitmapField BgField = new BitmapField(BottombackgroundBitmap, Field.NON_FOCUSABLE); _fieldManagerBottom.add(BgField);

    ////然后你把你的按钮和标签放到你想要的位置的绝对管理器上 CustomerBitmapButton yourButton; yourButton = new CustomerBitmapButton (yourButtonBitmap,60,60,Field.FOCUSABLE);
    _fieldManagerBottom.add(yourButton ,260,0);

    【讨论】:

      【解决方案2】:

      我刚刚找到了解决方案:

      HorizontalFieldManager hfm = new HorizontalFieldManager();
      
      final ImageButton home = new ImageButton("",Field.FOCUSABLE, "home.png","home.png", 0x9cbe95);
                  final ImageButton add = new ImageButton("",Field.FOCUSABLE, "add.png","add.png", 0x9cbe95);
                  final ImageButton plus = new ImageButton("",Field.FOCUSABLE, "plus.png","plus.png", 0x9cbe95);
                  final ImageButton bin = new ImageButton("",Field.FOCUSABLE, "bin.png","bin.png", 0x9cbe95);
      
                  home.setMargin(0,0,0,50);
      

      其他人也有类似的setmargins!!

      【讨论】:

        【解决方案3】:

        请注意,如果您在不同分辨率的设备上使用您的应用,这会给您带来麻烦。因此,您实际上应该通过检查设备分辨率来解决这个问题。

        if(Display.getWidth>320)
            setMargin(0,0,0,intFor320);
        else
            setMargin(0,0,0,intForLessThan320);
        

        【讨论】:

          猜你喜欢
          • 2011-07-25
          • 2011-08-03
          • 2011-08-15
          • 1970-01-01
          • 2015-10-05
          • 1970-01-01
          • 2011-09-16
          • 1970-01-01
          • 2014-08-08
          相关资源
          最近更新 更多