在UITableView上面添加工具栏,用于UISplitViewController详细视图 [英] add Toolbar above UITableView for use in UISplitViewController detail view

查看:160
本文介绍了在UITableView上面添加工具栏,用于UISplitViewController详细视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用表视图作为UISplitViewController中的详细信息窗格。如何将工具栏放在顶部?我想要能够以与非表细节视图相同的方式添加条按钮项。
感谢。

I want to use a table view as the detail pane in my UISplitViewController. How do I put the toolbar at the top? I want to be able to add bar button items in the same way as my non-table detail views. Thanks.

推荐答案

我对这个问题的沮丧是试图使用UITableViewController类,添加其他UI元素(如工具栏)。我解决了它通过创建一个UIViewController对象,并单独添加工具栏和表视图到其nib。然后我有ViewController实现表视图的委托和数据源方法。工程伟大。

My frustration with this problem lay in trying to use the UITableViewController class, which does not allow you to add other UI elements like a toolbar. I solved it by creating a UIViewController object and adding the toolbar and table view to its nib individually. I then had the ViewController implement the table view's delegate and data source methods. Works great.

这篇关于在UITableView上面添加工具栏,用于UISplitViewController详细视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆