在videDidLoad中,我有在详细信息视图控制器中设置导航栏的代码
UIImage *emptyImage = [UIImage new];
[self.navigationController.navigationBar setBackgroundImage:emptyImage forBarMetrics:UIBarMetricsDefault];
self.navigationController.navigationBar.shadowImage = emptyImage;
self.navigationController.navigationBar.tintColor = [UIColor greenColor];
此详细视图将在拆分视图控制器中显示为细节,并在较小的设备中推送到导航堆栈,因此在这种情况下我使用show detail segue。
在拆分视图控制器中,此详细视图控制器将导航栏显示为透明且色调正确,但在iPhone导航栏中不遵循我的设置并显示为默认颜色和样式。
你知道如何使这项工作。我猜它是因为内部进程在推入较小设备的导航堆栈之前删除了导航控制器。
答案 0 :(得分:0)
您尝试过吗?
UINavigationController *lc_navigationController = (UINavigationController *)self.splitViewController.viewControllers.firstObject;
lc_navigationController.navigationBar.barTintColor = [UIColor greenColor];