ZinkNavigation 1.0.1

ZinkNavigation 1.0.1

测试已测试
语言语言 Obj-CObjective C
许可证 MIT
发布最后发布2019年2月

zinkLin 维护。



  • Zink

ZinkNavigation

  • 简化导航栏设置

内容

开始使用

能做什么

  • ZinkNavigation 大大简化了导航栏的设置操作,可以快速配置导航栏的常用功能

安装

使用CocoaPods

pod 'ZinkNavigation'

#import "UINavigationController+Zink.h"

示例

/**
 *  设置导航栏背景颜色
 */
- (void)zinkSetBackgroundColor:(UIColor *)color;
[self.navigationController zinkSetBackgroundColor:[UIColor redColor]];

source1

/**
 *  设置导航栏标题
 */
- (void)zinkSetTitle:(NSString *)title;
[self.navigationController zinkSetTitle:@"Zink"];

source2

/**
 *  设置导航栏标题样式
 */
- (void)zinkSetTitleColor:(UIColor *)color
                     font:(UIFont *)font;
[self.navigationController zinkSetTitleColor:[UIColor whiteColor] font:[UIFont boldSystemFontOfSize:23]];

source3

/**
 *  设置电池条风格(前提:先在项目plist中添加 View controller-based status bar appearance,并将属性设置为NO)
 */
- (void)zinkSetStatuBarStyle:(StatuBarStyle)style;
[self.navigationController zinkSetStatuBarStyle:StatuBarStyleLight];

source4

/**
 *  添加导航栏上的按钮,
 *  这个函数会返回一个默认的Button,如果Button的UI不是你所预期的,你可以获取这个Button,并对它进行修改
 *
 *  @param title               按钮标题
 *  @param iconImageName       按钮图标
 *  @param backgroundImageName 按钮背景图
 *  @param target              事件触发对象
 *  @param action              事件
 *  @param orientation         按钮的位置(左、右)
 *
 *  @return 按钮
 */
- (UIButton *)zinkAddItemWithTitle:(NSString *)title
                         iconImage:(NSString *)iconImageName
                   backgroundImage:(NSString *)backgroundImageName
                            target:(id)target
                            action:(SEL)action
                       orientation:(BarItemOrientation)orientation;
UIButton *button = [self.navigationController zinkAddItemWithTitle:@"push"
                                          iconImage:nil
                                    backgroundImage:nil
                                             target:self
                                             action:@selector(showOtherViewController)
                                        orientation:BarItemOrientationRight];

source5

/**
 *  设置导航栏标题视图
 */
- (void)zinkSetTitleView:(UIView *)view;
UISwitch *switchZ = [UISwitch new];
[self.navigationController zinkSetTitleView:switchZ];

source6