如何使用 JavaScript 检查 snapview 是否正常工作。
var SNAPPED_VIEW = 320;
window.addEventListener("resize", onViewStateChanged);
function onViewStateChanged(eventArgs) {
var viewStates = Windows.UI.ViewManagement.ApplicationViewState, msg;
var newViewState = Windows.UI.ViewManagement.ApplicationView.value;
if (newViewState === viewStates.snapped) {
var msg = new Windows.UI.Popups.MessageDialog("snap view mode");
} else if (newViewState === viewStates.filled) {
showMenu('filled');
} else if (newViewState === viewStates.fullScreenLandscape) {
showMenu('landscape');
} else if (newViewState === viewStates.fullScreenPortrait) {
//Currently not supported
}
}
我正在尝试使用此代码,但在使用断点时显示未定义。