UIViewController-TransparentNavBar 1.3

UIViewController-TransparentNavBar 1.3

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Jun 2015

Maintained by Fraser Scott-Morrison.



  • By
  • Fraser Scott-Morrison

A UIViewController category that can make the navigation bar transparent

Description

UIViewController+TransparentNavBar is a category that allows you to set your UINavigationBar background to transparent or to any UIColor you choose.

Because its a UIViewController category, the UINavigationBar background can be changed each time a UIViewController is pushed or popped into the navigation hierarchy.

How to install

Add this to your CocoaPods Podfile.

pod 'UIViewController-TransparentNavBar'

How to use

In your UIViewController

#import "UIViewController+TransparentNavBar.h"
- (void)viewWillAppear:(BOOL)animated {
    // to set transparent
    [self setNavBarColor:[UIColor clearColor]];

    // to set a custom color
    [self setNavBarColor:[UIColor yellowColor]];

    // to set back to default grey color
    [self setNavBarColor:nil];
}

Treat yourself to these other libraries of mine

An elegant solution for keeping any UIView visible when the keyboard is being shown https://github.com/IdleHandsApps/IHKeyboardAvoiding

Tap to dismiss the keyboard with IHKeyboardDismissing https://github.com/IdleHandsApps/IHKeyboardDismissing

A drop in nav controller with cool parallax transitions https://github.com/IdleHandsApps/IHParallaxNavigationController

Author

License

Distributed under the MIT License