//
//  UIViewController+navibarSetting.m
//  TTSDKUIDemo
//
//  Created by 小软 on 2017/12/5.
//  Copyright © 2017年 路鹏. All rights reserved.
//

#import "UIViewController+navibarSetting.h"

@implementation UIViewController (navibarSetting)
- (void)setNavi:(NSString *)title{
    
    UIView * container = [[UIView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, NAV_BAR_HEIGHT)];
    [self.view addSubview:container];
    
    UIButton * backBtn = [[UIButton alloc] initWithFrame:CGRectMake(0,NAV_BAR_HEIGHT - 64 , 40, 64)];
    [backBtn setTitle:@"返回" forState:UIControlStateNormal];
    [backBtn addTarget:self action:@selector(rj_backAction) forControlEvents:UIControlEventTouchUpInside];
    [backBtn setTitleColor:[UIColor blueColor] forState:UIControlStateNormal];
    
    UILabel * titleLabel = [UILabel new];
    titleLabel.font = [UIFont systemFontOfSize:17.0];
    titleLabel.textColor = [UIColor darkGrayColor];
    titleLabel.text = title;
    [titleLabel sizeToFit];
    
    [container addSubview:titleLabel];
    container.backgroundColor = [UIColor lightGrayColor];
    
    

}
- (void)rj_backAction{
    [self.navigationController popViewControllerAnimated:YES];
}
@end
