开发者

Showing a UIActionSheet

开发者 https://www.devze.com 2022-12-11 02:50 出处:网络
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 s开发者_Go百科how it in but I get the MainView Undeclar

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 s开发者_Go百科how it in but I get the MainView Undeclared error.


You need to reference the controllers view:

[actionSheet showInView:self.viewController.view]


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


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

[[[UIApplication sharedApplication] delegate] window];
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号