Playbook 视图上的选项菜单

发布于 2024-12-26 16:57:36 字数 61 浏览 3 评论 0原文

如何在 Playbook 视图上制作选项菜单?是否有标准 API 可以做到这一点,我正在使用 Air SDK

How to make option menu on Playbook view? Is there standard APIs to do that, I am using Air SDK

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

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

发布评论

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

评论(1

初相遇 2025-01-02 16:57:36

我在尝试 AIR 时找不到 API,但我找到了解决方法。

基本上,我在 QNXApplication 中注册了触摸事件,并使用 Tweener 手动显示和隐藏我的菜单。

假设您将菜单作为视图,那么您可以执行以下操作:

// call back function when the main view is loaded
protected function registerMenu( event:FlexEvent ):void
{
    QNXApplication.qnxApplication.addEventListener( 
                                   QNXApplicationEvent.SWIPE_DOWN, 
                                   pullDownMenu );
    navigator.addElement(menu);
}

private function pullDownMenu( event:QNXApplicationEvent ):void
{

    Tweener.addTween(menu, {y: 0, time: 0.5, transition: "linear"});                                   
    navigator.stage.addEventListener(MouseEvent.CLICK, onStageMouseClick);
    trace("menu down");
}           

private function onStageMouseClick( e:MouseEvent ):void
{
    if (mouseY > menu.height)
    {
       Tweener.addTween(menu, {y: -menu.height, time: .3, transition: "linear"});                               
       trace("menu up");
    }
}

这是我记得的非常简单的示例(不再有代码),但是对此函数和对象的一些谷歌搜索可能会帮助您如果退出,则在没有 API 的情况下实现应用程序菜单。

如果您发现其他方法,请在此发布以供参考。

I couldn't find the API at the time I was experimenting with AIR, but I found a work around.

Basically I registered for touch events in QNXApplication and was manually showing and hiding my menu with the use of the Tweener.

Suppose you have you menu as a view than you could do the following:

// call back function when the main view is loaded
protected function registerMenu( event:FlexEvent ):void
{
    QNXApplication.qnxApplication.addEventListener( 
                                   QNXApplicationEvent.SWIPE_DOWN, 
                                   pullDownMenu );
    navigator.addElement(menu);
}

private function pullDownMenu( event:QNXApplicationEvent ):void
{

    Tweener.addTween(menu, {y: 0, time: 0.5, transition: "linear"});                                   
    navigator.stage.addEventListener(MouseEvent.CLICK, onStageMouseClick);
    trace("menu down");
}           

private function onStageMouseClick( e:MouseEvent ):void
{
    if (mouseY > menu.height)
    {
       Tweener.addTween(menu, {y: -menu.height, time: .3, transition: "linear"});                               
       trace("menu up");
    }
}

This is very simple example that I can remember (don't have the code anymore), but a bit of google-ing on this functions and objects might help you to implement the application menu without the API if it exits.

If you find another way of doing it, please post it here for reference.

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