Change color of translucent black UINavigationBar

前端 未结 4 1414
后悔当初
后悔当初 2020-12-24 05:45

I stumbled upon this many times, never found a solution. A UINavigationController\'s navigationBar can be set to black translucent like:

self.navigationContr         


        
4条回答
  •  时光取名叫无心
    2020-12-24 06:23

    Once you know it, it's fairly simple:

    self.navigationController.navigationBar.tintColor = [UIColor blueColor];
    self.navigationController.navigationBar.alpha = 0.7f;
    self.navigationController.navigationBar.translucent = YES;
    

    The translucent property seems only to determine wether the main view should be visible under the navigation bar, and resizes the view appropiately.

提交回复
热议问题