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

MTransparentNav

Change NavigationBar’s color and transparency at push pop scroll

导航栏滑动渐变

Language
Support

image
image

Package RTRootNavigationController & Category of UINavigationBar & UIViewController’s category

The Usage of RTRootNavigationController
[https://github.com/rickytan/RTRootNavigationController]

image

Usage

In the need to change the color of the controller

self.navTintColor = [UIColor redColor];
self.navBarTintColor = [UIColor greenColor];
self.navAlpha = 0;

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.navTintColor = [UIColor blueColor];
    } else {
        self.navTintColor = y < 0 ? [UIColor clearColor] : [UIColor redColor];
    }
}

Install

pod ‘TransparentNav’

import "TransparentNav.h"

Related articles

iOS导航栏滑动渐变

Latest podspec

{
    "name": "TransparentNav",
    "version": "1.0.0",
    "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.0"
    },
    "source_files": "TransparentNav/TransparentNav/**/*",
    "requires_arc": true
}

Pin It on Pinterest

Share This