美文网首页
whose view is not in the window

whose view is not in the window

作者: hj_Ma | 来源:发表于2019-07-15 10:19 被阅读0次

    最近在做项目遇到了这样一个问题,登录页添加调用H5的人脸识别,里面用到了相册和摄像头,但是在弹出相册选择的ActionSheet后,不管选择相机,相册都失败,控制台并报whose view is not in the window hie 错误。查了下资料并测试发现是 只要是不是rootviewController resent到人脸识别网页都报这个错,换成push没有问题。

    解决办法:

    通过测试发现是根控制器的问题,可以通过更改根控制器解决这个问题。
      NYLoginVC *logVC = [[NYLoginVC alloc]initWithNibName:@"NYLoginVC" bundle:nil];
      logVC.isSelecteBarIndex=YES;

      ILNavigationController *nav = [[ILNavigationController alloc] initWithRootViewController:logVC];

    //        [self.window.rootViewController presentViewController:nav animated:YES completion:^{

    //        }];

    以前用的presentViewController 不用了 换成  rootViewController,然后push到H5调用的人脸的页面

            self.window.rootViewController = nav;

    相关文章

      网友评论

          本文标题:whose view is not in the window

          本文链接:https://www.haomeiwen.com/subject/wpegkctx.html