Latest 1.0.1
Homepage https://github.com/MQZHot/MTransparentNav
License MIT
Platforms ios 8.0, requires ARC
Authors

MTransparentNav

Change NavigationBar’s color and transparency

导航栏滑动渐变

Usage

In the need to change the color of the controller

self.navAlpha = 0;
self.navTintColor = [UIColor whiteColor];
self.navTitleColor = [UIColor whiteColor];
self.navBackgroundColor = [UIColor greenColor];

You can change nav tintColor and barTintColor in UIScrollViewDelegate

-(void)scrollViewDidScroll:(UIScrollView *)scrollView{
    CGFloat y = scrollView.contentOffset.y;
    self.navAlpha = y / 80;
    if (y > 80) {
        self.navTitleColor = self.navTintColor = [UIColor redColor];
    } else {
        self.navTitleColor = y < 0 ? [UIColor clearColor] : [UIColor whiteColor];
        self.navTintColor = y < 0 ? [UIColor clearColor] : [UIColor whiteColor];
    }
}

Install

  • pod ‘TransparentNav’

  • import "TransparentNav.h"

Related articles

iOS导航栏滑动渐变

Author

LICENSE

MTransparentNav is released under the MIT license. See LICENSE for details.

Latest podspec

{
    "name": "TransparentNav",
    "version": "1.0.1",
    "summary": "Change NavigationBar's color and transparency when push pop scroll",
    "homepage": "https://github.com/MQZHot/MTransparentNav",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "mqz": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/MQZHot/MTransparentNav.git",
        "tag": "1.0.1"
    },
    "source_files": "MTransparentNav/MTransparentNav/**/*",
    "requires_arc": true
}

Pin It on Pinterest

Share This