iOS UINavigationBar button remains faded after segue back

This is a bug in iOS 11.2 and happens because the UIBarButtonItem stays highlighted after navigation and does not return to its normal state after the other view controller pops. To avoid this behavior, either use a UIBarButtonItem with a UIButton as a custom view disable and re-enable the bar button item in viewWillDisappear(_:) (although … Read more

iOS 11 large navigation bar title unexpected velocity

I solved the problem with these constraints: NSLayoutConstraint.activate([ scrollView.topAnchor.constraint(equalTo: view.topAnchor), scrollView.leftAnchor.constraint(equalTo: view.leftAnchor), scrollView.bottomAnchor.constraint(equalTo: view.bottomAnchor), scrollView.rightAnchor.constraint(equalTo: view.rightAnchor) ]) You also have to set this property on your UIViewController subclass: extendedLayoutIncludesOpaqueBars = YES

how to hide navigationbar when i push from navigation controller?

Put this code in the view controller you want to hide the navigation bar for. – (void) viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; [self.navigationController setNavigationBarHidden:YES animated:animated]; } And you may also want to stick this in there, depending on your needs: – (void) viewWillDisappear:(BOOL)animated { [super viewWillDisappear:animated]; [self.navigationController setNavigationBarHidden:NO animated:animated]; }

How to animate add UISearchBar on top of UINavigationBar

I’ve modified Mark’s answer a little to get it to work in IOS 8 and in swift. class ViewController : UIViewController, UISearchBarDelegate { var searchBar = UISearchBar() var searchBarButtonItem: UIBarButtonItem? var logoImageView : UIImageView! override func viewDidLoad() { super.viewDidLoad() // Can replace logoImageView for titleLabel of navbar let logoImage = UIImage(named: “logo-navbar”)! logoImageView = UIImageView(frame: … Read more

iOS 7 Status Bar Collides With NavigationBar

The latest version of the iOS has brought many visual changes and from a developer’s point of view, the navigation and status bar are two noticeable changes. The status bar is now transparent and navigation bar behind it shows through. The navigation bar image can even be extended behind the status bar. First of all, … Read more

Change font of back navigation bar button

To change the appearance of the text in all UIBarButtonItems appearing in all UINavigationBars, do the following in application:didFinishLaunchingWithOptions: [[UIBarButtonItem appearanceWhenContainedIn:[UINavigationBar class], nil] setTitleTextAttributes: @{UITextAttributeTextColor:[UIColor blackColor], UITextAttributeTextShadowOffset:[NSValue valueWithUIOffset:UIOffsetMake(0, 1)], UITextAttributeTextShadowColor:[UIColor whiteColor], UITextAttributeFont:[UIFont boldSystemFontOfSize:12.0] } forState:UIControlStateNormal]; UPDATE: iOS7 friendly version NSShadow *shadow = [[NSShadow alloc] init]; shadow.shadowOffset = CGSizeMake(0.0, 1.0); shadow.shadowColor = [UIColor whiteColor]; [[UIBarButtonItem appearanceWhenContainedIn:[UINavigationBar … Read more

How do I disable the navigation bar shadow in iOS 6 for navigation bars with custom background images?

Place this in your AppDelegate [[UINavigationBar appearance] setShadowImage:[UIImage new]]; // is IOS 7 and later [[UINavigationBar appearance] setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault]; Swift version with updates from comments UINavigationBar.appearance().shadowImage = UIImage() UINavigationBar.appearance().setBackgroundImage(UIImage(), forBarMetrics: .Default)