LTNavigationBar

UINavigationBar Category which allows you to change its appearance dynamically

  • Owner: ltebean/LTNavigationBar
  • Platform:
  • License:: MIT License
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

LTNavigationbar

Deprecated

This lib uses a hacky way to achieve the result, in the new iOS version, the structure of UINavigation is changed and this lib no longer works anymore, so please check these alternatives:

swift version

https://github.com/ltebean/LTNavigationBar/tree/swift3.0

Purpose

It is hard to change the appearance of UINavigationBar dynamically, so I made this lib to make the job easy.

Demo

1. Changing the background color:

LTNavigationbar

2. Making navigation bar scroll along with a scroll view:

LTNavigationbar

Usage

First, import this lib:

#import "UINavigationBar+Awesome.h"

The category includes lots of method that helps to change UINavigationBar's appearance dynamically:

@interface UINavigationBar (Awesome)
- (void)lt_setBackgroundColor:(UIColor *)backgroundColor;
- (void)lt_setElementsAlpha:(CGFloat)alpha;
- (void)lt_setTranslationY:(CGFloat)translationY;
- (void)lt_reset;
@end

You can call the various setter wherever you want, like:

[self.navigationController.navigationBar lt_setBackgroundColor:[UIColor blueColor]];

And usually in viewWillDisappear, you should call this method to avoid any side effects:

- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
    [self.navigationController.navigationBar lt_reset];
}

See the example for details~

Main metrics

Overview
Name With Ownerltebean/LTNavigationBar
Primary LanguageObjective-C
Program languageObjective-C (Language Count: 2)
Platform
License:MIT License
所有者活动
Created At2015-02-15 11:01:25
Pushed At2018-09-26 10:37:42
Last Commit At2017-07-20 10:27:00
Release Count17
Last Release Namev2.1.9 (Posted on )
First Release Namev0.1.0 (Posted on )
用户参与
Stargazers Count4.5k
Watchers Count111
Fork Count678
Commits Count52
Has Issues Enabled
Issues Count63
Issue Open Count31
Pull Requests Count7
Pull Requests Open Count7
Pull Requests Close Count4
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private