【发布时间】:2018-10-25 12:01:54
【问题描述】:
我有应用程序在 iOS 上进行本机反应,我通过这样做将其锁定为横向模式:
componentDidMount() {
Orientation.lockToLandscape()
}
我添加了一个弹出窗口,但是当我按下它时,我得到了这个错误:
Exception thrown while executing UI block:
Supported orientations has no common orientation with the application,
and [RCTModalHostViewController shouldAutorotate] is returning YES
在 app.delegate 上我添加了这个函数:
- (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
while ([[UIDevice currentDevice] isGeneratingDeviceOrientationNotifications]) {
[[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications];
}
return [Orientation getOrientation];
}
在纵向上没有发生此错误
我该如何解决...谢谢
【问题讨论】:
标签: ios react-native popover landscape