Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>One low-fi way would probably be pinning a <code>UIView</code> that is the height of the Navigation Bar to the top of the view behind the bar. Make that view the same color as the navigation bar but play with the alpha until you get the desired effects:</p> <pre><code>UIView *backgroundView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.navigationController.navigationBar.frame), 64)]; backgroundView.backgroundColor = [UIColor colorWithRed:0.0 green:0.0 blue:1 alpha:.5]; [self.navigationController.view insertSubview:backgroundView belowSubview:self.navigationController.navigationBar]; </code></pre> <h2>UIView behind</h2> <p><img src="https://i.stack.imgur.com/c3CMI.png" alt="enter image description here"></p> <p>(Changed color from lower examples to emphasis transparency. Transparency/blurring is more noticeable when in movement.)</p> <p>Subclassing the <code>UINavigationBar</code> and placing that same view above the background but behind everything else will probably achieve similar results while being less hacky.</p> <hr> <p><strike> Another solution I've seen tossed around is playing with the alpha of the <code>UINavigationBar</code>:</p> <pre><code>self.navigationController.navigationBar.alpha = 0.5f; </code></pre> <p></strike> Edit: Actually, after testing it seems like this doesn't provide the intend behavior (or any behavior):</p> <h2>.8 alpha</h2> <p><img src="https://i.stack.imgur.com/nMhLz.png" alt="Navigation bar with .8 alpha"></p> <h2>Unadjusted alpha</h2> <p><img src="https://i.stack.imgur.com/rorI0.png" alt="enter image description here"></p> <p>Obviously, you will only want to do this on iOS 7 devices. So, <a href="https://stackoverflow.com/questions/3339722/check-iphone-ios-version">add some version check</a> before you implement any of these.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload