Showing a UIActionSheet
Asked Answered
B

3

7

I was wondering how to show a UIActionSheet from the bottom of the screen. I have tried using the showInView: method with MainView as the view to show it in but I get the MainView Undeclared error.

Behlke answered 9/11, 2009 at 16:58 Comment(0)
I
11

You need to reference the controllers view:

[actionSheet showInView:self.viewController.view]
Issacissachar answered 9/11, 2009 at 17:1 Comment(1)
also look at the UIActionSheet docs for details on showFromToolbar and showFromTabBar, if you have either a tabbar or toolbar.Lilliamlillian
W
8

If you attempt to show the UIActionSheet on the window though you use TabBar or ToolBar UI, The bottom part of the ActionSheet doesn't respond to your touch. You'd be better to use as follows:

[[[UIApplication sharedApplication] delegate] window];

Weinberg answered 10/11, 2009 at 0:24 Comment(0)
B
2

or you can show it in the main window. it will be useful if you have a tabbar application.

[[[UIApplication sharedApplication] delegate] window];
Barogram answered 9/11, 2009 at 17:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.