//
// BackFactory.h
// mobileoa
//
// Created by zhangjian01 on 16/12/20.
// Copyright © 2016年 zhangjian01. All rights reserved.
//
#import
@interface BackFactory : NSObject
+ (void)addBackItemToVC:(UIViewController *)vc;
@end
//
// BackFactory.m
// mobileoa
//
// Created by zhangjian01 on 16/12/20.
// Copyright © 2016年 zhangjian01. All rights reserved.
//
#import "BackFactory.h"
#import "UIControl+BlocksKit.h"
//#import
@implementation BackFactory
+ (void)addBackItemToVC:(UIViewController *)vc{
//[UIImage imageNamed:@"Today_icon_02.png"]
UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
[btn setImage:[[CoreUserDefined getSkinImage:@"Today_icon_02"] imageWithScaleToSize:CGSizeMake(18, 18)] forState:UIControlStateNormal];
[btn setImage:[[CoreUserDefined getSkinImage:@"Today_icon_02"] imageWithScaleToSize:CGSizeMake(18, 18)] forState:UIControlStateHighlighte
d];
btn.frame = CGRectMake(0, 0, 45, 44);
[btn bk_addEventHandler:^(id sender) {
[vc.navigationController popViewControllerAnimate
d:YES];
} forControlEvents:UIControlEventTouchUpIns
ide];
UIBarButtonItem *menuItem=[[UIBarButtonItem alloc] initWithCustomView:btn];
//使用弹簧控件缩小菜单按钮和边缘距离
UIBarButtonItem *spaceItem=[[UIBarButtonItem alloc] initWithBarButtonSystemI
tem:UIBarButtonSystemItemFix
edSpace target:nil action:nil];
spaceItem.width = -13;
vc.navigationItem.leftBarButtonItems = @[spaceItem,menuItem];
}
@end
//
//
//
//
//
//
#import
@interface BackFactory : NSObject
+ (void)addBackItemToVC:(UIViewController *)vc;
@end
//
//
//
//
//
//
//
#import "BackFactory.h"
#import "UIControl+BlocksKit.h"
//#import
@implementation BackFactory
+ (void)addBackItemToVC:(UIViewController *)vc{
}
@end