0

在此处输入图像描述

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

谢谢!!

4

3 回答 3

0

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

if(Display.getWidth>320)
    setMargin(0,0,0,intFor320);
else
    setMargin(0,0,0,intForLessThan320);
于 2012-10-12T18:32:54.227 回答
0

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

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

///--here you add the background image to your toolbar BitmapField BgField = new BitmapField(BottombackgroundBitmap, Field.NON_FOCUSABLE); _fieldManagerBottom.add(BgField);

////then you put your buttons and labels to the absolute manager at the position you want CustumerBitmapButton yourButton; yourButton = new CustumerBitmapButton (yourButtonBitmap,60,60,Field.FOCUSABLE);
_fieldManagerBottom.add(yourButton ,260,0);

于 2012-10-12T11:41:19.010 回答
0

我刚刚找到了解决方案:

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也相似!!

于 2012-10-12T11:42:28.350 回答