windows - 如何在移动应用程序的 WinJS 中抑制硬件后退按钮事件?

标签 windows windows-phone windows-phone-8.1 winjs win-universal-app

没有像 event.stopPropogation() 或 PreventDefault() 这样的默认方法。 如何停止事件的默认行为(硬件后退按钮)?!

最佳答案

这是解决方案。

var app = WinJS.Application;

app.onbackclick = function (evt) {

    // Code that handles event ...

    // Need to return true to cancel the default behavior of this event.
    return true;
}

关于windows - 如何在移动应用程序的 WinJS 中抑制硬件后退按钮事件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31207748/

相关文章:

windows-8.1 - Windows App 确定 TextBlock 是否被修剪

c# - 当我重新启动我的模拟器时,我无法在 sqlite Windows Phone 8.1 中检索数据库值

python - 如何在系统关闭时运行 Python 脚本 (Windows 7)

c# - 在 C 中查找事件用户目录的路径

c# - 如何设置 WNetAddConnection2 的 CONNECT_PROMPT?

ios - 在 iOS 中生成 SHA256

visual-studio - "Windows Phone applications"和 "Silverlight for Windows Phone applications"有什么区别?

c# - 如何在 Windows Phone 8 上创建此哈希

c# - 如何从 Windows Phone 8.1(不是 Silverlight)联系人获取生日

windows - NSIS 以静默模式重新启动。如何沟通?