您的位置:首页 > 产品设计 > UI/UE

iOS7 - UIActionSheet 按钮不响应点击事件的解决方法

2015-05-28 18:03 411 查看
项目支持iOS8及iOS7版本,但在iOS7版本上出现了下面问题:

如果在项目中使用了UIActionSheet和UITabBarViewController,那么actionSheet的最底下的一个按钮可能就不会响应你的触摸事件,原因是被tabbar覆盖了,下面是xcode中出现的警告信息:

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:].
解决方法:把  actionSheet.showInView(self.view)更改为actionSheet.showInView(UIApplication.sharedApplication().keyWindow!)


OK!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: