iOS 7 Changing UINavigationBar titleView alpha

后端 未结 3 2015
无人共我
无人共我 2021-01-06 09:10

So I am using the UINavigationBar component of iOS7, but not the UINavigationController itself. When I push a new view with my custom navigation controller, I want to change

3条回答
  •  孤城傲影
    2021-01-06 09:33

    You can set the titleView hidden in viewWillAppear

    - (void)viewWillAppear:(BOOL)animated
    {
        [super viewWillAppear:animated];
    
        self.navigationItem.titleView.hidden = YES;
    }
    

    You can't set the titleView alpha until viewDidAppear

    - (void)viewDidAppear:(BOOL)animated
    {
        [super viewDidAppear:animated];
    
        self.navigationItem.titleView.alpha = 0.5f;
    }
    

提交回复
热议问题