单击黑莓轨迹球,而不是响应事件,而是显示上下文菜单,为什么?

发布于 2024-08-02 12:44:39 字数 254 浏览 3 评论 0原文

我在某些设备上遇到以下情况:当用户单击字段并期望响应时,设备不会正确响应该单击事件,而是在屏幕底部中心显示上下文菜单。

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 技术交流群。

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

发布评论

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

评论(4

寒尘 2024-08-09 12:44:39

我最近就遇到这样的情况。我扩展了 MainScreen 以提供一些基本功能,但不需要上下文菜单。从 naviationClick() 返回 true 消除了此行为。

public class MyScreen extends MainScreen {
    protected boolean navigationClick(int status, int time) {
        /*  
        ... custom behavior ... 
        */
        return true;
        // the following line would trigger the context menu
        //return super.navigationClick(status, time);
    }
}

我根本不需要重写 navigationUnclick() 。与 @JustinD 的覆盖 onMenu() 方法不同,这只会阻止菜单出现这种情况 - 而不是跨整个屏幕(您可能想要,这可能是更好的方法) )。

无论如何,这就是我最近使用点击和菜单的经验。

I recently had this happening. I was extending MainScreen to provide some basic functionality, but didn't want the context menus. Returning true from navigationClick() removed this behavior.

public class MyScreen extends MainScreen {
    protected boolean navigationClick(int status, int time) {
        /*  
        ... custom behavior ... 
        */
        return true;
        // the following line would trigger the context menu
        //return super.navigationClick(status, time);
    }
}

I didn't need to override navigationUnclick() at all. Unlike @JustinD's approach with override onMenu(), 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.

土豪我们做朋友吧 2024-08-09 12:44:39

你能发布你的代码吗?尝试重写 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.

掐死时间 2024-08-09 12:44:39

如果您重写 onMenu 并仅返回 true (您处理了菜单事件),那么菜单将不会显示...假设您也不需要完整的菜单 - 如果您想要完整的菜单而不是上下文菜单,那么只需执行 Jan 的操作即可说,你应该没问题 - 确保返回 true,否则事件将冒泡并最终生成菜单

public class MyClass Extends MainScreen
{
   ///
  // Override onMenu to prevent menu from coming up when you click trackwheel 
  public boolean onMenu(int instance)
  {
    return 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

public class MyClass Extends MainScreen
{
   ///
  // Override onMenu to prevent menu from coming up when you click trackwheel 
  public boolean onMenu(int instance)
  {
    return true;
  }
}
以往的大感动 2024-08-09 12:44:39

您可以在主屏幕中的所有字段上使用 CONSUME_CLICK 样式...

You could use CONSUME_CLICK style on all Fields in your MainScreen...

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