标签:
改动NavigationController的后退button标题
A push到B 。改动B的返回标题
仅仅要在A中加入以下的代码
<span style="font-size:18px;">UIBarButtonItem *backItem = [[UIBarButtonItem alloc] init]; backItem.title = @"返回"; self.navigationItem.backBarButtonItem = backItem;</span>
- (instancetype)initWithNavigationBarClass:(Class)navigationBarClass toolbarClass:(Class)toolbarClassNS_AVAILABLE_IOS(5_0);
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent]; UINavigationController *navigationController = [[UINavigationController alloc] initWithNavigationBarClass:[CRGradientNavigationBar class] toolbarClass:nil]; UIColor *firstColor = [UIColor colorWithRed:255.0f/255.0f green:42.0f/255.0f blue:104.0f/255.0f alpha:1.0f]; UIColor *secondColor = [UIColor colorWithRed:255.0f/255.0f green:90.0f/255.0f blue:58.0f/255.0f alpha:1.0f]; NSArray *colors = [NSArray arrayWithObjects:(id)firstColor.CGColor, (id)secondColor.CGColor, nil]; //NSArray *colors = [NSArray arrayWithObjects:(id)UIColorFromRGB(0xf16149).CGColor, (id)UIColorFromRGB(0xf14959).CGColor, nil]; [[CRGradientNavigationBar appearance] setBarTintGradientColors:colors]; [[navigationController navigationBar] setTranslucent:NO]; // Remember, the default value is YES. DemoViewController *viewController = [[DemoViewController alloc] init]; [navigationController setViewControllers:@[viewController]]; [self.window setRootViewController:navigationController]; self.window.backgroundColor = [UIColor whiteColor]; [self.window makeKeyAndVisible]; return YES; }
版权声明:本文博客原创文章。博客,未经同意,不得转载。
标签:
原文地址:http://www.cnblogs.com/mengfanrong/p/4684256.html