UINavigationBar custom back button without title

It’s actually pretty easy, here is what I do: Objective C // Set this in every view controller so that the back button displays back instead of the root view controller name self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@”” style:UIBarButtonItemStylePlain target:nil action:nil]; Swift 2 self.navigationItem.backBarButtonItem = UIBarButtonItem(title: “”, style: .Plain, target: nil, action: nil) Swift 3 self.navigationItem.backBarButtonItem … Read more

Trying to handle “back” navigation button action in iOS

Try this code using VIewWillDisappear method to detect the press of The back button of NavigationItem: -(void) viewWillDisappear:(BOOL)animated { if ([self.navigationController.viewControllers indexOfObject:self]==NSNotFound) { // Navigation button was pressed. Do some stuff [self.navigationController popViewControllerAnimated:NO]; } [super viewWillDisappear:animated]; } OR There is another way to get Action of the Navigation BAck button. Create Custom button for UINavigationItem … Read more

Imitate Facebook hide/show expanding/contracting Navigation Bar

The solution given by @peerless is a great start, but it only kicks off an animation whenever dragging begins, without considering the speed of the scroll. This results in a choppier experience than you get in the Facebook app. To match Facebook’s behavior, we need to: hide/show the navbar at a rate that is proportional … Read more

Make UINavigationBar transparent

If anybody is wondering how to achieve this in iOS 7+, here’s a solution (iOS 6 compatible too) In Objective-C [self.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault]; self.navigationBar.shadowImage = [UIImage new]; self.navigationBar.translucent = YES; In swift 3 (iOS 10) self.navigationBar.setBackgroundImage(UIImage(), for: .default) self.navigationBar.shadowImage = UIImage() self.navigationBar.isTranslucent = true In swift 2 self.navigationBar.setBackgroundImage(UIImage(), forBarMetrics: .Default) self.navigationBar.shadowImage = UIImage() self.navigationBar.translucent … Read more

How do I change the title of the “back” button on a Navigation Bar

This should be placed in the method that calls the ViewController titled “NewTitle”. Right before the push or popViewController statement. UIBarButtonItem *newBackButton = [[UIBarButtonItem alloc] initWithTitle:@”NewTitle” style:UIBarButtonItemStyleBordered target:nil action:nil]; [[self navigationItem] setBackBarButtonItem:newBackButton]; [newBackButton release];

iPhone Navigation Bar Title text color

Modern approach The modern way, for the entire navigation controller… do this once, when your navigation controller’s root view is loaded. [self.navigationController.navigationBar setTitleTextAttributes: @{NSForegroundColorAttributeName:[UIColor yellowColor]}]; However, this doesn’t seem have an effect in subsequent views. Classic approach The old way, per view controller (these constants are for iOS 6, but if want to do it per … Read more

How to change Navigation Bar color in iOS 7?

The behavior of tintColor for bars has changed in iOS 7.0. It no longer affects the bar’s background. From the documentation: barTintColor Class Reference The tint color to apply to the navigation bar background. @property(nonatomic, retain) UIColor *barTintColor Discussion This color is made translucent by default unless you set the translucent property to NO. Availability … Read more

Creating a left-arrow button (like UINavigationBar’s “back” style) on a UIToolbar

I used the following psd that I derived from http://www.teehanlax.com/blog/?p=447 http://www.chrisandtennille.com/pictures/backbutton.psd I then just created a custom UIView that I use in the customView property of the toolbar item. Works well for me. Edit: As pointed out by PrairieHippo, maralbjo found that using the following, simple code did the trick (requires custom image in bundle) … Read more

Tab bar controller inside a navigation controller, or sharing a navigation root view

The two previous answers got it right – I don’t use UITabBarController in Tweetie. It’s pretty easy to write a custom XXTabBarController (plain subclass of UIViewController) that is happy to get pushed onto a nav controller stack, but still lives by the “view controller” philosophy. Each “tab” on the account-specific view (Tweets/Replies/Messages) is its own … Read more