加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

iphone – 如何进入当前视图的UIToolbar

发布时间:2020-12-14 17:37:04 所属栏目:百科 来源:网络整理
导读:我有一个基于导航控制器的应用程序,并在viewDidLoad中添加了一些带代码的工具栏项: NSArray* toolbarItems = [NSArray arrayWithObjects: [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(ad
我有一个基于导航控制器的应用程序,并在viewDidLoad中添加了一些带代码的工具栏项:

NSArray* toolbarItems = [NSArray arrayWithObjects:
                         [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd 
                                                                       target:self
                                                                       action:@selector(addButton)],[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace 
                                                                       target:self
                                                                       action:nil],[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCompose 
                                                                       target:self
                                                                       action:@selector(composeMail)],nil];
[toolbarItems makeObjectsPerformSelector:@selector(release)];
self.toolbarItems = toolbarItems;

现在我想用[UIActionSheet showFromToolbar:]显示一个actionSheet,我想要一个UIToolbar *,我怎样才能得到我之前创建的UIToolbar?

解决方法

我假设你的意思是“当前视图控制器”.在这种情况下,您需要self.navigationController.toolbar.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读