admin
2023-04-21 0b3a4aaf99ea251bc8e27b96115288f0988fcffe
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
//
//  subregionViewController.m
//  BuWanVideo2.0
//
//  Created by apple on 2018/3/13.
//  Copyright © 2018年 com.yeshi.buwansheque.ios. All rights reserved.
//
 
#import "subregionViewController.h"
#import "subregionView.h"
@interface subregionViewController ()
@property (nonatomic,strong) subregionView *subrView;
@end
 
@implementation subregionViewController
- (instancetype)init {
    self = [super init];
    if (self) {
        self.title = @"分类";
//        UITabBarItem *item = [[UITabBarItem alloc]initWithTitle:self.title image:[UIImage imageNamed:@"Camera-拷贝"] selectedImage:[UIImage imageNamed:@"Camera"]];
//        item.titlePositionAdjustment = UIOffsetMake(0, -5);
//        self.tabBarItem = item;
    }
    return self;
}
 
- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    [self.navigationController setNavigationBarHidden:NO animated:animated];
    self.navigationController.navigationBar.translucent = NO;
    self.navigationController.navigationBar.backgroundColor=UIColor.whiteColor;
}
 
- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
}
 
- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    [self createNavgationBar];
    [self.view addSubview:self.subrView];
    UIView *cutLine=[[UIView alloc] init];
    cutLine.backgroundColor= [UIColor colorWithRed:0.75 green:0.75 blue:0.75 alpha:1];
    cutLine.frame=CGRectMake(0, 0, KScreenW, 1);
    [self.view addSubview:cutLine];
}
 
 
/**
 设置导航栏
 */
-(void)createNavgationBar{
    self.navigationItem.title = @"分类";
    self.navigationController.navigationBar.titleTextAttributes =@{NSFontAttributeName:[UIFont systemFontOfSize:18],NSForegroundColorAttributeName:[UIColor blackColor]};
    
    //返回按钮
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    [button setImage:[[UIImage imageNamed:@"ic_back"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateNormal];
    [button addTarget:self action:@selector(back:)
     forControlEvents:UIControlEventTouchUpInside];
    button.frame = CGRectMake(0, 0, 32, 32);
    UIBarButtonItem *iconBarItem=[[UIBarButtonItem alloc] initWithCustomView:button];
    self.navigationItem.leftBarButtonItem = iconBarItem;
    
}
 
 
-(void)back:(id)sender{
    [self.navigationController popViewControllerAnimated:YES];
}
 
 
 
- (subregionView *)subrView {
    if (_subrView) {
        return _subrView;
    }
    _subrView = [[subregionView alloc] initWithFrame:CGRectMake(0, 1, KScreenW, KScreenH - kStatusBarH - ALNavBarH - ALTabBar_H)];
    return _subrView;
}
 
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
 
/*
#pragma mark - Navigation
 
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/
 
@end