BlackBerry 编程 - 点击关闭弹出屏幕

发布于 2024-10-04 00:33:20 字数 158 浏览 0 评论 0原文

我有一个弹出屏幕(小屏幕)位于主屏幕顶部。

该弹出屏幕有一个按钮,单击该按钮将关闭屏幕。
您知道当用户在弹出屏幕覆盖的区域之外点击手机时如何关闭此弹出屏幕(无需单击按钮)吗?

仅供参考:应用程序设计为仅在触摸手机上运行(BB Storm、BB Torch...)

I have a popup screen (a small screen) stays on top of a main screen.

This popup screen has a button, the button will close the screen when clicked.
Do you know how to close this popup screen when users tapping on the phone, outside the area that the popup screen cover (without clicking the button)?

FYI: app is designed to run on touch phone only (BB Storm, BB Torch...)

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

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

发布评论

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

评论(2

删除→记忆 2024-10-11 00:33:20

您可以尝试覆盖屏幕和弹出窗口上的 touchEvent 方法。如果您在弹出窗口 touchEvent 中返回 true,则屏幕将接收的唯一 touchEvents 应该位于弹出窗口之外。

You can try overriding the touchEvent method on both the screen and the popup. If you return true in the popups touchEvent then the only touchEvents the screen will receive should be outside of the popup.

http://www.blackberry.com/developers/docs/5.0.0api/net/rim/device/api/ui/Field.html#touchEvent(net.rim.device.api.ui.TouchEvent)

反差帅 2024-10-11 00:33:20

目前尚不完全清楚您的问题是什么,但通常您可以使用此代码从屏幕堆栈中删除任何屏幕:

UiApplication.getUiApplication().popScreen(screen);

It's not entirely clear what you're after from your question, but generally you can use this code to remove any screen from the screen stack:

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