UIActionSheet cancel按钮不响应的问题

来源:互联网 发布:java工资扣培训费 编辑:程序博客网 时间:2024/04/30 12:50

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

解决方法如下:

UIActionSheet *removeActionSheet=[[UIActionSheet alloc]initWithTitle:titleforActionSheet delegate:selfcancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Ok" otherButtonTitles:nil, nil];

removeActionSheet.actionSheetStyle=UIActionSheetStyleDefault;

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


将原来showinView:self.view改为[[UIApplication sharedApplication].keyWindow]

原创粉丝点击