Carl
Carl

Reputation: 2934

Can I set a navigationBar transparent in Storyboard?

I have several UIViewControllers in a UITabBarController.

In each UIViewController's viewDidLoad method I include this line:

self.navigationController.navigationBar.translucent = NO;

Is there a setting in Storyboard that can do the same?

Upvotes: 1

Views: 5858

Answers (2)

Enrico Cupellini
Enrico Cupellini

Reputation: 445

I couldn't do this on storyboard (Xcode 8, iOS 10), instead I used a custom navigationBar and overriding the awakeFromNib:

-(void)awakeFromNib
{
    [self setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
    self.shadowImage = [UIImage new];
    self.translucent = YES;
}

Upvotes: 0

JE Herrejon
JE Herrejon

Reputation: 402

Yes, you can change the navigation bar of the navigation controller, just select it in the document outline, check this iOS7 nav bar translucent = NO

Upvotes: 1

Related Questions