帖子
帖子
用户
博客
课程
显示全部楼层
4
帖子
0
勋章
64
Y币

[插件开发] 我用apicloud 跳转原生模块,再pop回 apicloud 首页, 为何apicl...

[复制链接]
发表于 2023-4-25 14:39:39
我用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];
}
4
帖子
0
勋章
64
Y币
我用apicloud 首页   跳转原生模块,再pop回 apicloud  首页,  为何apicloud  首页 白屏了?
4
帖子
0
勋章
64
Y币
是不是js  要 加上这句代码  

  function apiready() {   
    api.removeLaunchView();
}
您好,这边反馈给开发看下
BIP921214 · 2023-4-25 14:41我用apicloud 首页   跳转原生模块,再pop回 apicloud  首页,  为何apicloud  首页 白屏了?

您好,这样写是可以的,发的代码有限定位不到问题,如果可以加我qq463699553工程发我我帮你看一下。
您需要登录后才可以回帖 登录

本版积分规则