当前位置:首页 > 开发 > 移动开发 > 正文

Presenting action sheet clipped by its superview

发表于: 2013-12-09   作者:dcj3sjt126com   来源:转载   浏览:
摘要: 转自: http://dongxin1390008.blog.163.com/blog/static/3179247820129148363384/   Presenting action sheet clipped by its superview.Some controls might not respond to touches.On iPhone try-[UIActionS

转自: http://dongxin1390008.blog.163.com/blog/static/3179247820129148363384/

 

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" 

 
  

                                                                     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 ];即可

Presenting action sheet clipped by its superview

  • 0

    开心

    开心

  • 0

    板砖

    板砖

  • 0

    感动

    感动

  • 0

    有用

    有用

  • 0

    疑问

    疑问

  • 0

    难过

    难过

  • 0

    无聊

    无聊

  • 0

    震惊

    震惊

版权所有 IT知识库 CopyRight © 2009-2015 IT知识库 IT610.com , All Rights Reserved. 京ICP备09083238号