gpt4 book ai didi

ios - iOS 中的 UIActionSheet 警告消息

转载 作者:行者123 更新时间:2023-12-01 17:32:08 25 4
gpt4 key购买 nike

我正在尝试显示 UIActionSheet来自 UINavigationController在 iOS 中。

当我使用 [action showInView:self.view];他们向我展示了如下警告信息。

Presenting action sheet clipped by its superview. Some controls might not respond to touches. On iPhone try -[UIActionSheet showFromTabBar:] or -[UIActionSheet showFromToolbar:] instead of -[UIActionSheet showInView:].

但是 UIActionSheet 显示正确,没有发生任何事情。

在我的 iOS 中,我支持横向模式,如以下代码。
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 3.0 ||
UIDeviceOrientationIsPortrait([[UIDevice currentDevice] orientation])) {
[action showInView:self.view];
} else {
[action showInView:self.view.window];

我想知道警告信息很重要吗?

或者我可以忽略该警告信息吗?

最佳答案

您的导航 Controller 是否显示工具栏?如果是这样,操作表的底部 44 点可能不会响应。要解决此问题,请使用 [action showFromToolbar:self.navigationController.toolbar] (就像错误消息所说的那样)。

如果您的导航 Controller 位于标签栏中,这同样适用,但您应该使用 [action showFromTabBar:self.tabBarController.tabBar] .

关于ios - iOS 中的 UIActionSheet 警告消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17617018/

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