在javascript Windows 8 Metro Style App中切换应用栏的事件是什么? [英] What is the event that toggles appbar in javascript Windows 8 Metro Style App?

查看:81
本文介绍了在javascript Windows 8 Metro Style App中切换应用栏的事件是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找可在javascript中切换应用栏的事件.因此,基本上,这是屏幕顶部/底部边缘上的边缘滑动"手势事件.

I am looking for the event that toggles the appbar in javascript. So it's basically the "edge-swipe" gesture event on the top/bottom edge of the screen.

例如,当用户滑动屏幕的上边缘或对接边缘时,我想在页面上显示文本边缘滑动",而无需在页面中声明应用栏.我将如何做到这一点?

For example, I want to show a text "edge swiped" on the page when the user swipe the upper or butto edge of the screen, without declaring a app bar in the page. How will I be able to do that?

我尝试过交叉滑梯事件,但似乎不正确.

I tried crossslide event and it doesn't seem to be right.

推荐答案

交叉滑动不适用于您,因为它是一种可以在任何地方开始的手势.

Cross-slide won't work for you because it's a gesture that can start anywhere.

没有向Metro应用程序公开的边缘滑动事件. Windows 8会检测到边缘滑动,并自动(如果有)为您升高应用栏.

There's no edge-slide event that is exposed to a Metro app. Windows 8 detects the edge-slide and raises the app bar for you automatically (when you have one).

也许他们将来会添加一个,但是谁知道是什么时候或什么时候来的,所以您可能想要进行自己的手势跟踪.我建议您看看PointerPoint类并构建自己的自定义手势识别器. 基本的边缘滑动应该足够容易识别,尽管您必须注意屏幕上的所有指针.例如,如果我有一个平板电脑,它可以跟踪5个手指,其中一个手指可以边缘滑动,那么您是否能识别手势,而不管还是仅在当时只有一个触摸点处于活动状态?这取决于你.

Maybe they'll add one in the future, but who know's if or when, so you'll probably want to do your own gesture tracking. I'd suggest you have look at the PointerPoint class and building your own custom gesture recognizer. A basic edge swipe should be easy enough to recognize, though you'll have to pay attention to all the pointers on screen. For example, if I have a tablet that tracks 5 fingers and one of them edge-slides, do you recognize the gesture regardless or only if there is a single touch point active at the time? That's up to you.

这篇关于在javascript Windows 8 Metro Style App中切换应用栏的事件是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆