How to change the navigation bar height

后端 未结 3 977
小鲜肉
小鲜肉 2021-01-13 08:58

I saw a solution to change the height of navigation bar. But nothing worked for me. Now my application has one view controller connected with a navigation controller. I have

3条回答
  •  青春惊慌失措
    2021-01-13 09:39

    UIView *NavView = [[UIView alloc] initWithFrame:CGRectMake(0, 0 , [UIScreen mainScreen].bounds.size.width , 44)];
    NavView.backgroundColor = [UIColor clearColor];
    NavView.userInteractionEnabled = YES;
    [self.navigationController.navigationBar addSubview:NavView];
    
    UIButton *DateBtn = [[UIButton alloc]initWithFrame:CGRectMake(0, 10, 90, 30)];
    DateBtn.backgroundColor = [UIColor clearColor];
    [DateBtn setTitle:@"Jan 05" forState:UIControlStateNormal];
    DateBtn.titleLabel.font = [UIFont fontWithName:BrushScriptStd size:18];
    [DateBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [NavView addSubview:DateBtn];
    

提交回复
热议问题