我照着Native.js的例子这样写的:
function userDidTakeScreenshot( notification ){
console.log("已经截图");
}
mui.plusReady(function(){
if ( plus.os.name == "iOS" ) {
NSNotificationCenter = plus.ios.importClass("NSNotificationCenter");
var nc = NSNotificationCenter.defaultCenter();
var delegate = plus.ios.implements("NSObject",{"userDidTakeScreenshot:":userDidTakeScreenshot});
nc.addObserverselectornameobject(delegate,
plus.ios.newObject("@selector","userDidTakeScreenshot:"),
"UIApplicationUserDidTakeScreenshotNotification",
null);
} else {
alert("Android");
}
}
但是一截屏,程序就崩溃退出了,而且hbuilder中看不到崩溃日志. 求问怎么解决?
1***@qq.com
怎么重写
2019-10-16 21:18
oliviaxr
请问一下怎么写?
2021-05-07 14:30