Showing a UIActionSheet

2019-02-17 00:30发布

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.

3条回答
混吃等死
2楼-- · 2019-02-17 00:44

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

查看更多
够拽才男人
3楼-- · 2019-02-17 00:50

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

[[[UIApplication sharedApplication] delegate] window];
查看更多
成全新的幸福
4楼-- · 2019-02-17 01:02

You need to reference the controllers view:

[actionSheet showInView:self.viewController.view]
查看更多
登录 后发表回答