Code Monkey home page Code Monkey logo

cfynavigationbartransition's Introduction

一个设置NavigationBar颜色、透明度、隐藏/显示工具 — — CFYNavigationBarTransition

详细介绍

  使用CFYNavigationBarTransition可以为每个ViewController的NavigationBar设置自己的颜色、透明度、以及隐藏/显示,并且不同样式的NavigationBar在进行push或者pop时,动画过度和谐美观。效果如下:

修改NavigationBar样式 不同样式的NavigationBar进行pop时的过度

安装

  • 方法一,下载代码直接将CFYNavigationBarTransition文件夹拖入工程
  • 方法二,使用Cocoapods,支持iOS 8以上系统 pod 'CFYNavigationBarTransition'

使用

  引用:#import "CFYNavigationBarTransition.h",调用一下接口

  • 改变navigationBar的颜色,调用:[viewController cfy_setNavigationBarBackgroundColor:]
  • 改变navigationBar的背景图,调用:[viewController cfy_setNavigationBarBackgroundImage:]
  • 改变navigationBar的透明度,调用:[viewController cfy_setNavigationBarAlpha:]
  • 改变navigationBar的ShadowImage,调用:[viewController cfy_setNavigationBarShadowImage:]
  • 改变navigationBar的ShadowImage的BackgroundColor,调用:[viewController cfy_setNavigationBarShadowImageBackgroundColor:]
  • 隐藏/显示则直接调用UINavigationController中原生的设置NavigationBar隐藏的方法[navigationController setNavigationBarHidden:][navigationController setNavigationBarHidden:animated:]

注意

  注意事项:不要设置NavigationBar的translucent为NO,原因是设置了translucent=NO,NavigationBar就不能透明了。

更新列表

1.0.0

  • 加入修改bar背景图接口
  • 加入修改bar的shadowImage图片接口
  • 加入修改bar的shadowImage的背景色接口
  • 优化代码逻辑

0.0.3 ~ 0.0.6

  • 修复bug

0.0.2

  • 修复iOS8上奔溃的问题

0.0.1

  • 可修改bar背景色
  • 可修改bar透明度

cfynavigationbartransition's People

Contributors

caffreysun avatar

Watchers

 avatar

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.