UIActionSheet在有TABBAR的显示问题

当APP中使用到tabbar,会出现部分按钮无法响应的问题。在xcode的控制台中也会报出相应的错误,提示使用从tabbar加载的信息。

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 *removeActionSheet=[[UIActionSheet alloc]initWithTitle:titleforActionSheet delegate:selfcancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Ok" otherButtonTitles:nil, nil];

removeActionSheet.actionSheetStyle=UIActionSheetStyleDefault;

[removeActionSheet showInView:[UIApplication sharedApplication].keyWindow];

你可能感兴趣的:(action)