如何在WinJS for Mobile App中抑制硬件后退按钮事件?

时间:2015-07-03 13:14:06

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

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

1 个答案:

答案 0 :(得分:4)

这是解决方案。

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;
}
相关问题