UIViewController-TransparentNavBar 1.3

UIViewController-TransparentNavBar 1.3

测试已测试
Lang语言 Obj-CObjective C
许可证 MIT
发布最后发布2015年6月

Fraser Scott-Morrison 维护。



  • Fraser Scott-Morrison

UIViewController类别,可以使导航栏透明

描述

UIViewController+TransparentNavBar是一个类别,允许您将导航栏的背景设置为透明,或选择您选择的任何UIColor。

因为它是UIViewController类别,每次将UIViewController推入或弹出导航层次结构时,都可以更改UINavigationBar的背景。

如何安装

将此代码添加到您的CocoaPods Podfile中。

pod 'UIViewController-TransparentNavBar'

如何使用

在您的UIViewController中

#import "UIViewController+TransparentNavBar.h"
- (void)viewWillAppear:(BOOL)animated {
    // to set transparent
    [self setNavBarColor:[UIColor clearColor]];

    // to set a custom color
    [self setNavBarColor:[UIColor yellowColor]];

    // to set back to default grey color
    [self setNavBarColor:nil];
}

享受这些其他库

键盘显示时保持任何UIView可见的优雅解决方案 https://github.com/IdleHandsApps/IHKeyboardAvoiding

使用IHKeyboardDismissing轻触以关闭键盘 https://github.com/IdleHandsApps/IHKeyboardDismissing

带有酷炫视差转换效果的导航控制器 https://github.com/IdleHandsApps/IHParallaxNavigationController

作者

许可证

在MIT许可证下分发