Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The behavior of <code>tintColor</code> for bars has changed in iOS 7.0. It no longer affects the bar's background.</p> <p>From the documentation:</p> <p><strong>barTintColor</strong> <a href="https://developer.apple.com/library/ios/documentation/uikit/reference/UINavigationBar_Class/Reference/UINavigationBar.html#//apple_ref/occ/instp/UINavigationBar/barTintColor">Class Reference</a> </p> <p>The tint color to apply to the navigation bar background.</p> <pre><code>@property(nonatomic, retain) UIColor *barTintColor </code></pre> <p><strong>Discussion</strong><br> This color is made translucent by default unless you set the translucent property to <code>NO</code>.</p> <p><strong>Availability</strong> </p> <p>Available in iOS 7.0 and later. </p> <p><strong>Declared In</strong><br> <a href="https://developer.apple.com/library/ios/documentation/uikit/reference/UINavigationBar_Class/Reference/UINavigationBar.html">UINavigationBar.h</a></p> <h3>Code</h3> <pre><code>NSArray *ver = [[UIDevice currentDevice].systemVersion componentsSeparatedByString:@"."]; if ([[ver objectAtIndex:0] intValue] &gt;= 7) { // iOS 7.0 or later self.navigationController.navigationBar.barTintColor = [UIColor redColor]; self.navigationController.navigationBar.translucent = NO; }else { // iOS 6.1 or earlier self.navigationController.navigationBar.tintColor = [UIColor redColor]; } </code></pre> <p>We can also use this to check iOS Version as mention in <a href="https://developer.apple.com/library/ios/documentation/userexperience/conceptual/TransitionGuide/SupportingEarlieriOS.html">iOS 7 UI Transition Guide</a></p> <pre><code>if (floor(NSFoundationVersionNumber) &lt;= NSFoundationVersionNumber_iOS_6_1) { // iOS 6.1 or earlier self.navigationController.navigationBar.tintColor = [UIColor redColor]; } else { // iOS 7.0 or later self.navigationController.navigationBar.barTintColor = [UIColor redColor]; self.navigationController.navigationBar.translucent = NO; } </code></pre> <p><strong>EDIT</strong> Using xib </p> <p><img src="https://i.stack.imgur.com/Pvu9O.png" alt="enter image description here"></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

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