我用apicloud 跳转原生模块,再pop回 apicloud 首页, 为何apicloud 首页 白屏了?
AIcloud 跳转 模块NELocalModeVC 在 push 多个viewcontroller 之后再 pop 回rootviewcontroller (apicloud 的控制器包含webview) pop 回来就界面白屏了! 什么原因? 是不是 pop 回来 , webview 被销毁了 ,怎么刷新 重建?
js 代码
function showAlert() {
var demo = api.require('moduleDemo');
demo.showAlert({
title: '提示',
msg: 'Hello App!'
},function(ret, err){
var msg = "点击了第" + ret.index + "个按钮";
api.toast({
msg: msg,
location: 'middle'
});
});
OC 代码JS_METHOD(showAlertUZModuleMethodContext *)context) {
NSDictionary *param = context.param; NSString *title = [param stringValueForKey"title" defaultValue:nil]; NSString *msg = [param stringValueForKey"msg" defaultValue:nil]; UIAlertController *alert = [UIAlertController alertControllerWithTitle:title message:msg preferredStyle:UIAlertControllerStyleAlert]; [alert addAction:[UIAlertAction actionWithTitle"取消" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { NSDictionary *ret = @{@"index"(1)}; [context callbackWithRet:ret err:nil delete:YES]; }]]; [alert addAction:[UIAlertAction actionWithTitle"确定1" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { NSDictionary *ret = @{@"index"(2)}; [context callbackWithRet:ret err:nil delete:YES]; }]]; // [self.viewController presentViewController:alert animated:YES completion:nil];
NELocalModeVC *localModeVC=[[NELocalModeVC alloc] init]; [self.navigationController pushViewController:localModeVC animated:YES]; } |