The navigationBar is not transparent on the DetailViewController of the UISplitViewController.

Asked 2 years ago, Updated 2 years ago, 40 views

In the DetailViewController of the project created using Master-Detail, an Xcode model,

override func viewWillAppear(animated:Bool){
    super.viewWillAppear(animated)

    // Navigation Transparency
    self.navigationController!.navigationBar.setBackgroundImage(UIImage(), forBarMetrics: .Default)
    self.navigationController!.navigationBar.shadowImage=UIImage()
}

The navigationBar is not transparent.

navBar?.tintColor=UIColor.redColor()

reacts and the < button turns red.

Furthermore
Even if you write the code above to the Master side,
It is not transparent.

How can I make it transparent?

swift xcode

2022-09-30 16:00

1 Answers

This requires an understanding of how the Show Detail Segue behaves.

The Detail UINavigationController is not used when the screen is separated between Master and Detail.Replace the beginning of the ViewController stack in UINavigationController on the Master.

If you check the iPhone 6S Plus Landscape or iPad, you will see that it is transparent.

It's transparent, isn't it?


2022-09-30 16:00

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.