LTNavigationBar

UINavigationBar Category which allows you to change its appearance dynamically

  • 所有者: ltebean/LTNavigationBar
  • 平台:
  • 許可證: MIT License
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

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~

主要指標

概覽
名稱與所有者ltebean/LTNavigationBar
主編程語言Objective-C
編程語言Objective-C (語言數: 2)
平台
許可證MIT License
所有者活动
創建於2015-02-15 11:01:25
推送於2018-09-26 10:37:42
最后一次提交2017-07-20 10:27:00
發布數17
最新版本名稱v2.1.9 (發布於 )
第一版名稱v0.1.0 (發布於 )
用户参与
星數4.5k
關注者數111
派生數678
提交數52
已啟用問題?
問題數63
打開的問題數31
拉請求數7
打開的拉請求數7
關閉的拉請求數4
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?