如何在iOS8中删除UINavigationBar透明性?

nav*_*r p 1 transparency objective-c uinavigationbar ios

我做了我UINavigationBar transparentViewDidLoad()使用下面的代码和

    [self.navigationController.navigationBar setBackgroundImage:[UIImage new]
                                                  forBarMetrics:UIBarMetricsDefault];
    self.navigationController.navigationBar.shadowImage = [UIImage new];
    self.navigationController.navigationBar.translucent = YES;
    self.navigationController.view.backgroundColor = [UIColor clearColor];
Run Code Online (Sandbox Code Playgroud)

这工作正常,我想删除此透明度并恢复()UINavigationBar上的旧(正常ViewDidDisappear)。

我如何正常UINavigationBar

Raj*_*rya 5

在代码中编写以下行:

[self.navigationController.navigationBar setTranslucent:NO]
Run Code Online (Sandbox Code Playgroud)

并删除下面的代码

self.navigationController.navigationBar.shadowImage = [UIImage new]; self.navigationController.view.backgroundColor = [UIColor clearColor];