【问题标题】:Warning: Attempt to present <UINavigationController> on <RNNSideMenuController> which is already presenting <RCTModalHostViewController>警告:尝试在已呈现 <RCTModalHostViewController> 的 <RNNsideMenuController> 上呈现 <UINavigationController>
【发布时间】:2020-02-13 04:08:58
【问题描述】:

我正在使用in-app-payments-react-native-plugin 插件将 Square 支付方式集成到 react native 中。在 iOS 中,如果在 Add new card react native popup 上打开卡片输入模型,则会产生问题。我有一个弹出窗口来添加新的信用卡详细信息,并在弹出窗口中调用卡输入模型时从包中收到此警告。如果不是从弹出屏幕调用,它可以在 android 和 iOS 上运行。

Xcode 内部的警告::

Warning: Attempt to present <UINavigationController: 0x7fba6b163400>  on <RNNSideMenuController: 0x7fba6b15fa00> which is already presenting <RCTModalHostViewController: 0x7fba6d798340>

我正在使用 Xcode 版本“11.0”并反应原生“0.61.4”。

这个包的objective-c代码产生这个警告::

UIViewController *rootViewController = UIApplication.sharedApplication.keyWindow.rootViewController;

if ([rootViewController isKindOfClass:[UINavigationController class]]) {
    [((UINavigationController *)rootViewController) pushViewController:cardEntryForm animated:YES];
} else {
    UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:cardEntryForm];
    [rootViewController presentViewController:navigationController animated:YES completion:nil];
}

这里的 if 部分正在工作,但 if 语句会生成此警告。我是目标 c 的新手。请提出这里发生了什么问题。

【问题讨论】:

标签: react-native react-native-ios square


【解决方案1】:

我认为不能同时打开 2 个模态框。就我而言,我关闭了第一个模式,并在打开第二个模式之前设置了 500 毫秒的时间。它解决了我的问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-11-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-01-07
    • 2014-10-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多