All Projects → MoZhouqi → Kmnavigationbartransition

MoZhouqi / Kmnavigationbartransition

Licence: mit
A drop-in universal library helps you to manage the navigation bar styles and makes transition animations smooth between different navigation bar styles while pushing or popping a view controller for all orientations. And you don't need to write any line of code for it, it all happens automatically.

Programming Languages

objective c
16641 projects - #2 most used programming language
swift
15916 projects
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Kmnavigationbartransition

RRNavigationBar
bring UINavigationBar to UIViewController.
Stars: ✭ 11 (-99.66%)
Mutual labels:  navigationbar, navigationbar-transition
Ypnavigationbartransition
A Full functional UINavigationBar framework for making bar transition more natural! You don't need to call any UINavigationBar api, implementing YPNavigationBarConfigureStyle protocol for your view controller instead. (类似微信 iOS Navigation Bar 的切换方案)
Stars: ✭ 725 (-77.86%)
Mutual labels:  transition, navigationbar
d3-canvas-transition
transition on canvas with d3
Stars: ✭ 19 (-99.42%)
Mutual labels:  transition
React Css Transition Replace
A React component to animate replacing one element with another.
Stars: ✭ 288 (-91.2%)
Mutual labels:  transition
Sheet
📑 Actionsheet with navigation features such as the Flipboard App
Stars: ✭ 264 (-91.94%)
Mutual labels:  transition
state-workflow
State Workflow Management Package For Laravel. Inspired by ROAM Horizon State Management Package.
Stars: ✭ 29 (-99.11%)
Mutual labels:  transition
Samuraitransition
SamuraiTransition is an open source Swift based library providing a collection of ViewController transitions featuring a number of neat “cutting” animations.
Stars: ✭ 269 (-91.78%)
Mutual labels:  transition
previewSlider
Responsive fullscreen image slider where the users are able to preview next/previous image when hovering over the navigation arrows.
Stars: ✭ 16 (-99.51%)
Mutual labels:  transition
Tltransitions
快速实现控制器的转场和View的快速popover显示,并支持自定义动画、手势退场
Stars: ✭ 296 (-90.96%)
Mutual labels:  transition
Guillotinemenu Android
Neat library, that provides a simple way to implement guillotine-styled animation
Stars: ✭ 2,743 (-16.22%)
Mutual labels:  transition
Viewpagertransition
viewpager with parallax pages, together with vertical sliding (or click) and activity transition
Stars: ✭ 3,017 (-7.85%)
Mutual labels:  transition
Transitionexample
a demo of Transition Framework
Stars: ✭ 257 (-92.15%)
Mutual labels:  transition
dsim.cljc
Idiomatic and purely functional discrete event-simulation
Stars: ✭ 81 (-97.53%)
Mutual labels:  transition
Swipetransition
Allows trendy transitions using swipe gesture such as "swipe back anywhere".
Stars: ✭ 272 (-91.69%)
Mutual labels:  transition
ng-ionic-connectedanim
Connected Animation (Shared Element Transition) for Ionic Framework.
Stars: ✭ 12 (-99.63%)
Mutual labels:  transition
Google nav bar
A modern google style nav bar for flutter.
Stars: ✭ 290 (-91.14%)
Mutual labels:  navigationbar
AppleMusicTransition
AppleMusic Transition playBar -> playDetail
Stars: ✭ 21 (-99.36%)
Mutual labels:  transition
Youtube-Pagination-ProgressBar
Youtube app uses a nice ProgressBar for pagiantion.The ProgressBar goes down using transition and then dissapear when the process ends,so I created a Custom ProgresBar as youtube app has.
Stars: ✭ 25 (-99.24%)
Mutual labels:  transition
Wrnavigationbar
超简单!!! 一行代码设置状态栏、导航栏按钮、标题、颜色、透明度,移动等 WRNavigationBar which allows you to change NavigationBar's appearance dynamically
Stars: ✭ 2,923 (-10.72%)
Mutual labels:  navigationbar
Emotion Rating View
A library for animated rating view in Android apps.
Stars: ✭ 299 (-90.87%)
Mutual labels:  transition

KMNavigationBarTransition 中文介绍

A drop-in universal library helps you to manage the navigation bar styles and makes transition animations smooth between different navigation bar styles while pushing or popping a view controller for all orientations. And you don't need to write any line of code for it, it all happens automatically.

Screenshots

Now

KMNavigationBarTransition KMNavigationBarTransition

Before

KMNavigationBarTransition KMNavigationBarTransition

Introduction

The design concept of the library is that what you only need to care about is the background style of the navigation bar in the current view controller, without handling the various background styles while pushing or popping.

The library can capture the background style of the navigation bar in the disappearing view controller when pushing, and when you pop back to the view controller, the navigation bar will restore the previous style, so you don't need to consider the background style after popping. And you also don't need to consider it after pushing, because it is the view controller to be pushed that needs to be considered.

Usage

You don't need to import any header file when using this library, the library uses Method Swizzling to achieve the effect.

It is recommended to set the default background style of the navigation bar in the viewDidLoad method of the base view controller. When you need to change it, generally, you only need to do it in the viewDidLoad method of the current view controller, but if you need to support peek and pop on 3D Touch, you can do it in the viewWillAppear: method.

The following are some suggestions to set the background style of the navigation bar, and you can see the Example for details.

  • There are two methods to set the background style of the navigation bar, setBackgroundImage:forBarMetrics: and setBarTintColor:. It is recommended to use the former, you can see Known Issues for the details.

  • It is better not to change the value of the translucent property arbitrarily after initialization, otherwise the interface layout would be prone to confusion.

  • When the value of the translucent property is true, you can use the following mehod to make the navigation bar transparent:

    navigationController?.navigationBar.setBackgroundImage(UIImage(), forBarMetrics: .Default)
    navigationController?.navigationBar.shadowImage = UIImage() // shadowImage is the 1px line
  • You can change the alpha value of the background color of the navigaiton bar by changing the alpha value of the image in the setBackgroundImage:forBarMetrics: method.

  • You can use the following method to show or hide the navigation bar in viewWillAppear::

    override func viewWillAppear(animated: Bool) {
        super.viewWillAppear(animated)
        navigationController?.setNavigationBarHidden(hidden, animated: animated)
    }

    You'd better not do it in neither viewWillDisappear: nor other methods performing transitions, because it is not easy to manage. Again, what you only need to care about is the style of the navigation bar in the current view controller.

    Of course, you'd better not hide the navigaion bar, it might triggers some apple's bug with interactive pop gesture.

Installation

CocoaPods

You can install the latest release version of CocoaPods with the following command:

$ gem install cocoapods

Simply add the following line to your Podfile:

pod 'KMNavigationBarTransition'

Then, run the following command:

$ pod install

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate KMNavigationBarTransition into your Xcode project using Carthage, specify it in your Cartfile:

github "MoZhouqi/KMNavigationBarTransition"

Run carthage update to build the framework and drag the built KMNavigationBarTransition.framework into your Xcode project.

Requirements

  • iOS 7.0+

Known Issues

On iOS 8.2 or below, if you set the value of the translucent property to true and set the barTintColor for the background color, and then change the barTintColor, the background color of the navigation bar will flash when the interactive transition is cancelled.

To avoid this from happening, it is recommended to use setBackgroundImage:forBarMetrics: instead of setBarTintColor: to change the background color of the navigation bar.

License

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].