在Windows Phone 8.1检测的WebView把握事件 [英] detecting hold event in webview on windows phone 8.1

查看:244
本文介绍了在Windows Phone 8.1检测的WebView把握事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前工作的一个网页浏览器应用程序主要是在Windows 8.1手机瞄准胜利室温。现在我想弄清楚如何当一个用户按住在网页视图链接或图像检测按住事件,并显示上下文菜单。

I'm currently working on a web browser app mainly targeting win rt in Windows phone 8.1. I'm now trying to figure out how to detect the hold event when a user holds down a link or image in webview and display a context menu.

我怎么会去这样做?我将如何检测wp8.1事件?我知道我将不得不调用脚本,但什么是C#来检测事件?感谢:)

How would I go about doing this? How would I detect the event in wp8.1? I know I'll have to invoke script but what is the c# to detect the event? Thanks :)

推荐答案

您应该的WebView 调用脚本结合手势事件在JavaScript第一。阅读本: MSGestureHold | onmsgesturehold事件

You should invoke script in WebView for binding gesture event in javascript first. Read this:MSGestureHold | onmsgesturehold event

那你应该在 window.external.notify 上述> MSGestureHold 事件处理程序来通知你的的WebView 保留事件被触发。

Then you should use window.external.notify in the MSGestureHold event handler above to notify your WebView that Hold event is triggered.

不过的 WinRT的8.1 ​​WebView中被禁用 scriptnotify 非认证的网站(读评论),所以你应该找到一个解决方案解决这个问题。 这里是我的解决方案。

或者你可以的下载我演示直接。

这篇关于在Windows Phone 8.1检测的WebView把握事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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