iOS中的UIActionSheet警告消息

Fir*_*ist 1 cocoa-touch uiactionsheet ios

我试图显示UIActionSheetUINavigationControlleriOS中.

当我使用时,[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:].
Run Code Online (Sandbox Code Playgroud)

但是UIActionSheet显示正确,没有任何反应.

在我的iOS中,我支持横向模式,如下面的代码.

if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 3.0 ||
        UIDeviceOrientationIsPortrait([[UIDevice currentDevice] orientation])) {
        [action showInView:self.view];
    } else {
        [action showInView:self.view.window];
Run Code Online (Sandbox Code Playgroud)

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

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

Sco*_*ets 6

您的导航控制器是否显示工具栏?如果是这样,行动表的底部44点可能不会响应.要解决这个问题,请使用[action showFromToolbar:self.navigationController.toolbar](就像错误信息所示).

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