Git Product home page Git Product logo

gkfadenavigationcontroller's Introduction

GKFadeNavigationController

Version License Platform Releases

This is an example implementation of a UINavigationController with support of animated hiding and showing it's Navigation Bar.

Demo

Try it yourself

Online simulator on appetize.io

Features

  • Animates tint color
  • Takes care of the status bar color
  • Similar pattern to -preferredStatusbarStyle
  • Uses native controls where possible (e.g. back button)
  • Native looking translucent header
  • Demo project with elastic header image
  • iPhone X support
  • Black navigation bar style support

Installation

GKFadeNavigationController is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "GKFadeNavigationController"

Then update your pods with pod install.

Usage

  1. To run the example project, clone the repo, and run pod install from the Example directory first.
  2. Set your Navigation Controller class to GKFadeNavigationController in Storyboard
  3. Make your view controllers to conform GKFadeNavigationControllerDelegate protocol
  4. Implement -preferredNavigationBarVisibility (return GKFadeNavigationControllerNavigationBarVisibilityHidden or GKFadeNavigationControllerNavigationBarVisibilityVisible)
  5. Send a -setNeedsNavigationBarVisibilityUpdateAnimated:animated message to the navigation controller when you want to hide or show the navigation bar

You can see the attached demo project for easier reference.

Requirements

  • iOS 8 SDK

Works fine with iOS 11.

Known limitations

  • Items under the header are not clickable
  • Changing the status bar color happens in -viewDidAppear currently

Feel free to contribute or send me pull requests.

Changelog

GitHub Changelog and releases

Author

Gruber Kristóf, [email protected], @gklka

License

GKFadeNavigationController is available under the MIT license. See the LICENSE file for more info.

gkfadenavigationcontroller's People

Contributors

antoniotajuelo avatar csknns avatar gklka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gkfadenavigationcontroller's Issues

iOS 11上发生崩溃

具体来说,是这行代码引起的,似乎在iOS11上模糊不能够在添加子视图? [_visualEffectView addSubview:shadowView];

  • (UIVisualEffectView *)visualEffectView {
    if (!_visualEffectView) {
    // Create a the fake navigation bar background
    UIVisualEffect *blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleExtraLight];

      _visualEffectView = [[UIVisualEffectView alloc] initWithEffect:blurEffect];
      _visualEffectView.frame = CGRectMake(0, -20.f, self.view.frame.size.width, 64.f);
      _visualEffectView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
      _visualEffectView.userInteractionEnabled = NO;
      
      // Shadow line
      UIView *shadowView = [[UIView alloc] initWithFrame:CGRectMake(0, 63.5f, self.view.frame.size.width, 0.5f)];
      shadowView.backgroundColor = [UIColor colorWithWhite:0 alpha:0.2f];
      shadowView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
    

// [_visualEffectView addSubview:shadowView];
}

return _visualEffectView;

}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.