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的时候,调试的时候,突然显示这个警告,在stackoverflow上找到这个答案:http://stackoverflow.com/questions/4447563/last-button-of-actionsheet-does-not-get-clicked
在模拟器里面测试的时候,发现最下面一个按钮点击的时候,不是很好点击了,而且也出现了一大堆警告,这个博客上写出了答案: http://dale.leepood.com/2012/04/;
我的代码是这样写的:
UIBarButtonItem*setStyleButton=[[UIBarButtonItemalloc]initWithTitle:@"Style"标签:superview,sheet,self,showInView,Presenting,action,styleAlert,UIActionSheet,its From: https://blog.51cto.com/u_3457306/5948013
style:UIBarButtonItemStyleBorderedtarget:self
action:@selector(setNavigationControllerStyle:)];
-(void)setNavigationControllerStyle:(id)sender
{
//more code
//[styleAlert showInView:self.view];
[styleAlert showInView:[UIApplicationsharedApplication].keyWindow];
[styleAlert release];
}
将代码:
[styleAlert showInView:self.view]; 改为:
[styleAlert
showInView
:[
UIApplication
sharedApplication
].
keyWindow
];即可