iOS 7中的导航栏出现问题.iOS 8和iOS 9运行正常。我会尝试解释,我无法显示截图。
我有MainViewController。该主控制器嵌入在导航控制器中。在MainViewController的导航栏中,中间有徽标,左边是菜单图标(经典抽屉),右按钮项是设置。
从菜单控制器中,您可以选择显示记录列表。让我们调用那个列表RecordsViewController。 RecordsViewController在导航栏中有后退按钮,标题和过滤器按钮。每条记录都有一张图片。单击记录时,将显示新的PictureViewController。
在该视图控制器中,您可以向右/向左滑动到上一张/下一张图片。 RecordsViewController和PictureViewController在纵向和横向模式下工作。
我现在将逐步输入以创建问题:
编辑:我正在使用导航控制器导航栏和项目。所以这是在viewWillAppear
中调用的init导航栏方法:
- (void) initNavBar {
self.title = @"Records";
self.navigationItem.rightBarButtonItem.tintColor = PRIMARY_BACKGROUND_COLOR;
self.navigationItem.titleView = nil;
self.navigationController.navigationBar.tintColor = SECONDARY_TEXT_COLOR;
[self.navigationController.navigationBar setTitleTextAttributes:@{NSFontAttributeName : [UIFont fontWithName:@"ProximaNova-Light" size:17],
NSForegroundColorAttributeName : [UIColor blackColor]}];
[self.navigationController.navigationBar setBackgroundImage:[[UIImage alloc] init] forBarMetrics:UIBarMetricsDefault];
[self.navigationController.navigationBar setShadowImage:[[UIImage alloc] init]];
}
在我的MainViewController中使用与MainViewController不同的东西完全相同的方法。当我从横向转向纵向模式时,会显示正确的内容。我没有导航栏的插座。我直接使用导航控制器的导航栏。