[英]Can't customize UINavigationBar in with Show Detail Segue
在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导航栏中不遵循我的设置并显示为默认颜色和样式。
你知道怎么做这个工作吗? 我猜它是因为内部进程在推入导入堆栈之前删除导航控制器在较小的设备中。
你试过这个吗?
UINavigationController *lc_navigationController = (UINavigationController *)self.splitViewController.viewControllers.firstObject;
lc_navigationController.navigationBar.barTintColor = [UIColor greenColor];
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.