我正在使用RECurtainViewController在新的视图控制器中进行转换。在我的应用程序委托中,我设置了导航栏外观:
[[UINavigationBar appearance] setTitleTextAttributes: @{
UITextAttributeTextColor: [UIColor colorWithRed:255.0/255.0 green:255.0/255.0 blue:255.0/255.0 alpha:1.0],
UITextAttributeTextShadowColor: [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.8],
UITextAttributeTextShadowOffset: [NSValue valueWithUIOffset:UIOffsetMake(0.0f, 1.0f)],
UITextAttributeFont: [UIFont fontWithName:@"Helvetica" size:20.0f]
}];
带有导航栏的根视图控制器正确显示。但是,当我使用以下方法引入新的视图控制器时:
DemoViewController *test = [[DemoViewController alloc] init];
[self curtainRevealViewController:test
transitionStyle:RECurtainTransitionHorizontal];
UINavigationBar 外观设置回其默认值。任何想法如何使自定义外观持续存在?
编辑:
我注意到当显示 DemoViewController 时,我也在控制台中收到此警告:
Warning: Attempt to present <DemoViewController: 0x1ddaae70> on <ViewController: 0x1e892040> whose view is not in the window hierarchy!
但是,它仍然显示视图控制器。