重庆迈尖科技有限公司
2019-01-30 94217b294ccd75a34787eb04d6e273e99536e45b
BuWanVideo2.0/BaseViewController.m
@@ -19,11 +19,15 @@
- (void)viewDidLoad {
    [super viewDidLoad];
}
- (void)viewWillAppear:(BOOL)animated{
//    self.navigationController.navigationBar.translucent = NO;
    self.dataHot = @[].mutableCopy;
    [self getHotSearch];
    [self loadNavigationbar];
}
}
-(void)loadNavigationbar{
    //去掉titlie
    UIView *tview = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 0.01, 0.01)];
@@ -33,16 +37,23 @@
    [[UINavigationBar appearance] setShadowImage:[[UIImage alloc] init]];
    //    创建一个高20的假状态栏
    UIView *statusBarView = [[UIView alloc] initWithFrame:CGRectMake(0, -20, KScreenW, 20)];
//    CGRect statusBarFrame = [[UIApplication sharedApplication] statusBarFrame];
//    statusBarView.frame = statusBarFrame;
    if (KIsiPhoneX) {
        statusBarView.frame = CGRectMake(0, -44, KScreenW, 44);
    }
    NSLog(@"%f == %f  \n  %f === %f",KScreenH,KScreenW,[[UIScreen mainScreen] currentMode].size.height,[[UIScreen mainScreen] currentMode].size.width);
    //    设置颜色
    statusBarView.backgroundColor=kGlobalMainColor;
    [self.navigationController.navigationBar setBackgroundColor:kGlobalMainColor];
//    [self.navigationController.navigationBar setBackgroundColor:[UIColor orangeColor]];
    [self.navigationController.navigationBar addSubview:statusBarView];
    //搜索
    UIView *seachView = [[UIView alloc]initWithFrame:CGRectMake(0, 0,  KScreenW / 5 * 4, 30)];
    self.searchText = [[UITextField alloc]initWithFrame:CGRectMake(0, 0,seachView.frame.size.width, seachView.frame.size.height)];
    self.searchText.backgroundColor = [UIColor colorWithWhite:0.7 alpha:0.2];
    self.searchText.layer.cornerRadius = self.searchText.frame.size.height / 2;
    self.searchText.textColor = [UIColor whiteColor];
    self.searchText.font = [UIFont systemFontOfSize:14];
    UIView *leftView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 45, 25)];
@@ -83,7 +94,6 @@
    UILabel *WhiteLabel1=[[UILabel alloc] initWithFrame:CGRectMake(0, 0, 20, 10)];
    WhiteLabel1.backgroundColor=[UIColor clearColor];
    UIBarButtonItem *WhiteBarItem1=[[UIBarButtonItem alloc] initWithCustomView:WhiteLabel1];
    //添加 观看记录/下载/搜索 到导航栏
    self.navigationItem.rightBarButtonItems=[[NSArray alloc] initWithObjects:recordBarItem,searchItem,WhiteBarItem,nil];
}