Ios UIActionSheet没有';不出现
我尝试在UIViewController内创建UIActionSheet,如下所示:Ios UIActionSheet没有';不出现,ios,uiactionsheet,Ios,Uiactionsheet,我尝试在UIViewController内创建UIActionSheet,如下所示: discardAS = [[UIActionSheet alloc] initWithTitle:"title" delegate:self cancelButtonTitle:"Cancel" destructiveButtonTitle:"Discard" otherButtonTitles:nil]; discardAS.actionSheetStyle = UIActionSheetStyleDefa
discardAS = [[UIActionSheet alloc] initWithTitle:"title" delegate:self cancelButtonTitle:"Cancel" destructiveButtonTitle:"Discard" otherButtonTitles:nil];
discardAS.actionSheetStyle = UIActionSheetStyleDefault;
[discardAS showInView:[self view]];
当我唤起它-整个屏幕“暗淡”(好像行动表实际上在前台)-但我没有看到行动表。它似乎显示“屏幕外”
当我在iOS7上尝试这一点时,我可以看到一个白色的框向上射出,很快就离开了屏幕——就像操作表被放在屏幕顶部一样。当我点击窗口时,模糊消失了,一切都很正常——就像iOS7一样,如果你点击操作表,它就消失了
因此,我的结论是,这张行动单是关于(并且超出)屏幕范围的
我在控制台上也看到了以下内容
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:].
这两个我都试过了,结果都一样。显示self.view.frame会显示一个大约为0,0300200的矩形,因此它的尺寸不会太大
你知道为什么,或者如何修复/调试吗?为了子孙后代——答案是我的继承人中有一个“额外的视图控制器”——如下所述:试着注释第二行