我想在我的应用程序的每个 View 中显示相同的工具栏项。目前,在推送 View Controller 之前,我将 toolbarItems 属性设置为当前 View Controller 的值。
我可以设置导航 Controller 的 toolbarItems 属性,而不用担心我的各个 View Controller 的 toolbarItems 属性吗?
最佳答案
toolbarItems
UINavigationController 的属性对其自己的工具栏没有影响。您应该注意,它是从 UIViewController 继承的,并且仅当您将该导航 Controller 放入另一个导航 Controller 时才有效。
要更新可见的工具栏项目,您应该使用 setToolbarItems:animated:
导航 Controller 的顶 View Controller 上的方法。
关于ios - 在 UINavigationController 上设置 toolbarItems 属性,或者在 UINavigationController 中显示 UIViewController?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7855219/