我有一个UITabBarController
,它是UINavigationController
中的第二项。
UITabBarController
中的每个项目都是 UIViewController
的子类。如何创建一个显示在导航栏右上角的按钮,并根据选择的选项卡而变化。
我正在使用storyboards
,以防万一有实现此目的的 gui 方法。
实现 UITabBarControllerDelegate 方法 tabBarController:didSelectViewController: 然后根据选择的视图控制器设置 UINavigationController 的 rightBarButtonItem 以显示您希望它显示的任何内容。