Blackberry fieldManager 问题 8900 与 9550

发布于 2024-12-23 08:02:19 字数 1101 浏览 2 评论 0原文

按下并关闭新屏幕后,我的按钮组有点向右移动。

我向 VerticalFieldManager 添加了一些按钮。然后我在水平字段管理器上添加了垂直字段管理器以使按钮居中。

问题出在 BB 8900(Curve) 上一切正常。在 9550(触摸屏)上,仅当我第一次打开屏幕时它才起作用。但是,如果我基于此屏幕打开另一个屏幕并关闭打开的屏幕,按钮将移至右侧。但仅限于9550???在 Curve 上,我可以打开一个新屏幕并关闭新屏幕,看起来应该如此。有人知道这个问题吗?

VerticalFieldManager verticalFieldMng = new VerticalFieldManager();      
            ButtonField btnSendAdrViaSMS = new ButtonField("test");
            verticalFieldMng2.add(btnSendAdrViaSMS);
            ButtonField btn2 = new ButtonField("test2");
            verticalFieldMng2.add(btn2);
            ButtonField btn3 = new ButtonField("test2");
            verticalFieldMng2.add(btn3);

            HorizontalFieldManager horizontalFieldManager = new HorizontalFieldManager(HorizontalFieldManager.FIELD_HCENTER);
            horizontalFieldManager.add(verticalFieldMng2);
            add(horizontalFieldManager);

为了打开新屏幕,我使用

    Screen_SendSMS sendSMS = new Screen_SendSMS("",link);
UiApplication.getUiApplication().pushModalScreen(sendSMS);

并关闭屏幕,我使用 BB 设备的常规“后退键”,而不覆盖它。

My buttonset is kind of moving to the right after pushing and closing a new screen.

I added some Buttons to a VerticalFieldManager. Then I added the verticalFieldManager on a horizontalFieldManager to center the buttons.

The problem is on a BB 8900(Curve) is everything fine. On a 9550 (touch screen) it works only when Iam opening the screen the first time. But if I open based on this screen another screen and close the opened screen the buttons are moving to the right. But only on the 9550 ??? On the Curve I can open a new screen and close the new one and it looks like it should. Does someone know this problem?

VerticalFieldManager verticalFieldMng = new VerticalFieldManager();      
            ButtonField btnSendAdrViaSMS = new ButtonField("test");
            verticalFieldMng2.add(btnSendAdrViaSMS);
            ButtonField btn2 = new ButtonField("test2");
            verticalFieldMng2.add(btn2);
            ButtonField btn3 = new ButtonField("test2");
            verticalFieldMng2.add(btn3);

            HorizontalFieldManager horizontalFieldManager = new HorizontalFieldManager(HorizontalFieldManager.FIELD_HCENTER);
            horizontalFieldManager.add(verticalFieldMng2);
            add(horizontalFieldManager);

For opening the new screen i use

    Screen_SendSMS sendSMS = new Screen_SendSMS("",link);
UiApplication.getUiApplication().pushModalScreen(sendSMS);

And to close the screen i use the regular "back key" of the BB device without overwritting it.

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

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

发布评论

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

评论(1

凑诗 2024-12-30 08:02:19

这很奇怪,但在 BB 中我并不感到惊讶。

更新:在检查了我的一些居中代码之后,我可以说 Horizo​​ntalFieldManager 由于我猜想的滚动而在居中字段方面存在问题。因此,当我需要水平居中时,我使用 VerticalFieldManager,而当我必须垂直居中时,我使用 Horizo​​ntalFieldManager。

居中字段的基本模式是这样的:

    VerticalFieldManager vfm = new VerticalFieldManager(Manager.USE_ALL_WIDTH);
    Field toCenter = new <Field>(DrawStyle.HCENTER | Field.FIELD_HCENTER );
    vfm.add(toCenter);

在垂直方向上,它将是:

    HorizontalFieldManager hfm = new HorizontalFieldManager(Manager.USE_ALL_HEIGHT);
    Field toCenter = new <Field>(DrawStyle.VCENTER | Field.FIELD_VCENTER );
    hfm.add(toCenter);

您可以使用算术 OR 运算符将标志与其他样式标志组合起来。

在您的情况下,您必须执行此操作两次:首先使用按钮和 vfm,然后使用 vfm 和 hfm。

Thats pretty odd, but doesn't surprise me in BB.

UPDATE: After reviewing some of my code to center things, I can say that HorizontalFieldManager, because of the scrolling I guess, has problems to center fields. So when I need to center horizontally I use a VerticalFieldManager, and when I have to center vertically I use an HorizontalFieldManager.

The basic pattern to center fields is this:

    VerticalFieldManager vfm = new VerticalFieldManager(Manager.USE_ALL_WIDTH);
    Field toCenter = new <Field>(DrawStyle.HCENTER | Field.FIELD_HCENTER );
    vfm.add(toCenter);

In vertical, it would be:

    HorizontalFieldManager hfm = new HorizontalFieldManager(Manager.USE_ALL_HEIGHT);
    Field toCenter = new <Field>(DrawStyle.VCENTER | Field.FIELD_VCENTER );
    hfm.add(toCenter);

You can combine the flags with other style flag with arithmetic OR operator.

In your case you'd have to do this twice: firts with the buttons and the vfm, then with the vfm and hfm.

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