Issue with UIActionSheet
Solution 1
Try this, it worked for me perfectly:
[actionSheet showInView:[UIApplication sharedApplication].keyWindow];
Solution 2
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];
Solution 3
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.
Solution 4
[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.
Solution 5
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.
Joaquin McCoy
Updated on August 17, 2020Comments
-
Joaquin McCoy almost 4 years
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?
-
filou over 11 yearsperfectly :)) just what I was looking for!!
-
katzenhut about 11 years@VSN theres a problem with this if youopen the actionsheet in landscape mode. the actionsheet will enter the screen from the side and it will be rotated by 90 degrees. do you have any solution for that? because otherwise its really helpful. tia.
-
MANIAK_dobrii over 10 yearsThanks, this one was the only to work it out for me (with slight additions to work both with and without navigation controller). A had similar problem with a custom iOS6 + iOS7 window configuration, when for iOS7 you shift your window down 20 points and leave everything as it is.
-
Erwan about 10 yearsvery similar but less code and easier to remember, you could do: [actionSheet showInView:self.view.window]
-
LolaRun almost 10 yearsor self.navigationController.view Thanks