When I run my app and I click button for actionsheet appears this:
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:].
How can I fix?
Try this, it worked for me perfectly:
[actionSheet showInView:[UIApplication sharedApplication].keyWindow];
You could try [MyActionSheet showInView:super.view];
or if you have a UITabBar or UIToolbar then, as it suggests, you can use [MyActionSheet showFromTabBar:self.tabBarController.tabBar];
or [MyActionSheet showFromToolBar:self.toolbar];
It should be resolved to use [actionSheet showInView:self.parentViewController.view];
instead of self.view
if you are using UINavigationViewController
because this controller has top navigation bar as default.
[sheet showInView:[UIApplication sharedApplication].keyWindow];
sheet.frame = CGRectMake(0, [UIScreen mainScreen].bounds.size.height-sheet.frame.size.height, [UIScreen mainScreen].bounds.size.width, sheet.frame.size.height);
This should solve the problem.
I resolved my nearly-the-same case by:
YourAppDelegate *delegate = [[UIApplication sharedApplication] delegate];
[actionSheet showFromTabBar:delegate.tabBarController.tabBar];
assume you use TabBarController xCode template as a start.
Remember that your toolbar may be part of your navigation controller. You can access it with self.navigationController.toolbar
Another similar solution, which worked for me with a UIPageViewController -> UINavigationViewController -> TableViewController structure, is:
[actionSheet showInView:self.view.superview];
Use this:
[actionSheet showInView:self.view.window];
This will force the action sheet to be displayed above navigation bars and respond to all taps. Note however that if you use some left/right sliding menu libraries, this may result in the actionSheet to be presented off screen. Just test...
I tried all of the above answers to no avail. Ultimately, I found that the only solution was to reduce the number of items on the action sheet, which was overflowing.
Heres the Swift version:
actionSheet.showInView(UIApplication.sharedApplication().keyWindow)