单击黑莓轨迹球,而不是响应事件,而是显示上下文菜单,为什么?
我在某些设备上遇到以下情况:当用户单击字段并期望响应时,设备不会正确响应该单击事件,而是在屏幕底部中心显示上下文菜单。
navigationUnclick 和拨轮Unclick
根据我的阅读,我可以覆盖 navigationUnclick 和 trackwheelUnclick 以防止显示菜单。我在屏幕级别执行此操作,但重现居中菜单场景很困难。这是正确的方法吗?
为什么会出现这种情况?有什么办法可以解决这个问题吗?
I'm running into the following scenario on some devices: when the use clicks on field and expects an response, instead of properly responding to that click event, the device shows the context menu at the bottom center of the screen.
navigationUnclick and trackwheelUnclick
From what I've read, I can override navigationUnclick and trackwheelUnclick to prevent the menu from showing. I'm doing this as the screen level but reproducing the centered-menu scenario is difficult. Is this the correct approch?
Why does this happen? Is there any way to resolve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我最近就遇到这样的情况。我扩展了
MainScreen
以提供一些基本功能,但不需要上下文菜单。从 naviationClick()
返回true
消除了此行为。我根本不需要重写
navigationUnclick()
。与 @JustinD 的覆盖onMenu()
方法不同,这只会阻止菜单出现这种情况 - 而不是跨整个屏幕(您可能想要,这可能是更好的方法) )。无论如何,这就是我最近使用点击和菜单的经验。
I recently had this happening. I was extending
MainScreen
to provide some basic functionality, but didn't want the context menus. Returningtrue
from navigationClick()
removed this behavior.I didn't need to override
navigationUnclick()
at all. Unlike @JustinD's approach with overrideonMenu()
, this only prevents the menu from this certain case -- not across the entire screen (which you may want, and that would probably be a better way to do it).Anyway, that's been my experience with clicks and menus recently.
你能发布你的代码吗?尝试重写 trackwheelClick 和 navigationClick 而不是 Unlick 方法。还要确保在这些方法中返回 true。
Can you post your code? Try overriding trackwheelClick and navigationClick instead of the Unlick methods. Also make sure you return true in these methods.
如果您重写 onMenu 并仅返回 true (您处理了菜单事件),那么菜单将不会显示...假设您也不需要完整的菜单 - 如果您想要完整的菜单而不是上下文菜单,那么只需执行 Jan 的操作即可说,你应该没问题 - 确保返回 true,否则事件将冒泡并最终生成菜单
If you override onMenu and just return true (you handled the menu event) then the menu will not show up...assuming you don't need a full menu either - if you want full menu and not context menu then just do what Jan said and you should be fine - make sure to return true or else the event will bubble up and end up with the menu being generated
您可以在主屏幕中的所有字段上使用 CONSUME_CLICK 样式...
You could use CONSUME_CLICK style on all Fields in your MainScreen...