【发布时间】:2018-06-18 09:49:42
【问题描述】:
下面的图片是我的故事板,我希望在AppDelegate 展示Upcoming VC。下面是我在AppDelegate 的代码,我在调用时设法呈现Upcoming VC。
UIStoryboard *sb = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
UIViewController *vc=[sb instantiateViewControllerWithIdentifier:@"Upcoming"];
UINavigationController *nv = [[UINavigationController alloc] initWithRootViewController:vc];
nv.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self.window.rootViewController presentViewController:nv animated:YES completion:nil];
在Upcoming VC,我设法展示了navigationBar with title and background colour,但我的后退按钮< 仍然不见了。我的后退按钮是自动生成的。
-(void)viewWillAppear:(BOOL)animated{
self.navigationController.navigationBar.hidden = NO;
[self.navigationItem setHidesBackButton:FALSE];
//====Make the navigation Bar appear===
[self.navigationController.navigationBar setBackgroundImage:nil forBarMetrics:UIBarMetricsDefault];
self.navigationController.navigationBar.shadowImage = nil;
//=== Set the navigation Back < color
self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
[self.navigationController.navigationBar setBarTintColor : [ UIColor grayColor]];
//=== Set the navigation Bar text color
[self.navigationController.navigationBar
setTitleTextAttributes:@{NSForegroundColorAttributeName : [UIColor whiteColor]}];
self.navigationController.navigationBar.translucent = NO;
}
请帮忙。
【问题讨论】:
标签: ios objective-c uinavigationcontroller appdelegate back-button