Complete nav transparency in the navigation bar,

Source: Internet
Author: User

Complete nav transparency in the navigation bar,
Complete nav transparency in the navigation bar

-(Void) added in viewDidLoad {

Swift: Version

// 1. Set the view background color

// Self. view. backgroundColor = UIColor (white: 0.25, alpha: 1.0)

//

/// 2. Set the title attribute of the navigation bar: Set the title Color

// Self. navigationController ?. NavigationBar. titleTextAttributes = [NSForegroundColorAttributeName: UIColor. whiteColor ()]

/// 3. Set the foreground color of the navigation bar: Set the item color.

// Self. navigationController ?. NavigationBar. tintColor = UIColor. whiteColor ()

//

//// 4. Set the navigation bar to translucent

// Self. navigationController ?. NavigationBar. translucent = true

//

//// 5. Set the background image of the navigation bar

// Self. navigationController ?. NavigationBar. setBackgroundImage (UIImage (), forBarMetrics: UIBarMetrics. Default)

//

//// 6. Set the navigation bar shadow Image

// Self. navigationController ?. NavigationBar. shadowImage = UIImage ()

 

 

OC: Version

  

[Self. navigationController. navigationBar setTintColor: [UIColor whiteColor];

[Self. navigationController. navigationBar setTranslucent: true];

[Self. navigationController. navigationBar setBackgroundImage: [[UIImage alloc] init] forBarMetrics: UIBarMetricsDefault];
[Self. navigationController. navigationBar setShadowImage: [[UIImage alloc] init];

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.