ios - 执行 UI 块时引发 React Native 异常:一个视图一次只能与一个视图控制器关联
问题描述
我有这个问题。我似乎找不到解决方案。我正在尝试实现一个对话框。它在 Android 上运行良好。但目前在 iOS 上遇到了麻烦。请帮忙 :(
Exception thrown while executing UI block: A view can only be associated with at most one view controller at a time! View <RCTView: 0x7fe0e7e62ad0; reactTag: 355; frame = (0 0; 414 896); layer = <CALayer: 0x600003a877c0>> is associated with <UIViewController: 0x7fe0e7c4e450>. Clear this association before associating this view with <UIViewController: 0x7fe0e7c56060>.
__44-[RCTUIManager flushUIBlocksWithCompletion:]_block_invoke
RCTUIManager.m:1192
__44-[RCTUIManager flushUIBlocksWithCompletion:]_block_invoke.489
__RCTExecuteOnMainQueue_block_invoke
_dispatch_call_block_and_release
_dispatch_client_callout
_dispatch_main_queue_callback_4CF
__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
__CFRunLoopRun
CFRunLoopRunSpecific
GSEventRunModal
-[UIApplication _run]
UIApplicationMain
main
start
0x0
解决方案
推荐阅读
- c# - 如何使用反射在 C# 9 中查找协变属性覆盖的基类属性
- html - 样式化 HTML 输入元素以减小可输入宽度而不影响实际宽度
- javascript - setInterval 没有检测到 React 中的 useState 变化
- android - Android TextInputLayout 和 TextInputEditText 带有轮廓边框并在轮廓框上方显示提示文本
- c++ - 仅使用循环的 C++ 数字模式解决方案
- ffmpeg - 是否可以使用 ffmpeg 在单个命令中进行压缩和缩放?
- mysql - MySQL 如何找到在特定列中具有不同值的列的重复项?
- python - Django LOGIN_REDIRECT_URL 更改不会影响行为
- machine-learning - 手写的线性回归不会过拟合,即使它应该
- python - 从 3D 可视化中的颜色图中更改特定值的颜色 (mpl_toolkits.mplot3d: Axes3D)