gpt4 book ai didi

xcode - iPad - 在 iPad 上关闭全屏模态视图 Controller 后,屏幕部分不再接收触摸事件

转载 作者:行者123 更新时间:2023-12-02 02:15:43 26 4
gpt4 key购买 nike

我的 iPad(全屏)主视图顶部有一个工具栏。工具栏有一个 barButtonItem,按下时会显示一个弹出窗口。

在弹出窗口中,我有一个 UIButton,当按下它时,它会告诉代理(主视图 Controller )关闭弹出窗口并显示完整的页面模态视图。

一切正常。

当我关闭模态视图时,弹出窗口占据的屏幕区域(包括主视图和工具栏按钮)不再响应触摸事件。

如果我旋转设备并且仅在横向模式下出现,此问题会自行纠正。

有什么建议吗?

更新:在模拟器中运行时不会发生此错误,只会在实际 iPad 上发生。

委托(delegate)方法我必须关闭全屏模态视图..

- (void)fullScreenViewControllerDidFinish:(FullScreenWebViewController *)fullScreenWebView {
[self dismissViewControllerAnimated:YES completion:^{
[self setFullScreenWVC:nil];
[[self view] setNeedsLayout]; //Does't fix the issue
}];
}

更新:使用 Instruments,我得到了 iPad 来展示它是如何布置 subview 的。当模态视图被关闭时,它似乎认为 iPad 处于纵向模式,但设备显然处于横向模式。

enter image description here

最佳答案

我解决了这个问题。

我在用

UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation]; 

代替

UIDeviceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];

出于某种原因,iPad 的方向不正确。

感谢您的帮助。

关于xcode - iPad - 在 iPad 上关闭全屏模态视图 Controller 后,屏幕部分不再接收触摸事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10806008/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com