Blackberry fieldManager 问题 8900 与 9550
按下并关闭新屏幕后,我的按钮组有点向右移动。
我向 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这很奇怪,但在 BB 中我并不感到惊讶。
更新:在检查了我的一些居中代码之后,我可以说 HorizontalFieldManager 由于我猜想的滚动而在居中字段方面存在问题。因此,当我需要水平居中时,我使用 VerticalFieldManager,而当我必须垂直居中时,我使用 HorizontalFieldManager。
居中字段的基本模式是这样的:
在垂直方向上,它将是:
您可以使用算术 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:
In vertical, it would be:
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.