How to remove UINavigationBar transparency in iOS8?

1.3k views Asked by At

I made my UINavigationBar transparent in ViewDidLoad() using below code and

    [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];

This is working perfectly and i want to remove this transparency and get back old (normal ) UINavigationBar on ViewDidDisappear( ).

How do I get normal UINavigationBar ?

1

There are 1 answers

4
Rajesh Maurya On

Write the below line in your code:

[self.navigationController.navigationBar setTranslucent:NO]

And remove below code

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