告诉我怎么做自定义导航栏trasparent Iphone X?这是我想要的照片。这是我做的代码。但当我修复图片时,这些变化并没有发生。透明的导航栏和状态栏变得普通。我所有的数据都被我固定的移位了。
告诉我你还需要添加什么,以便我也有它?
我的代码:ViewController
override func viewDidLoad() {
super.viewDidLoad()
UIApplication.shared.statusBarStyle = .default
}
AppDelegate。敏捷的
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
UINavigationBar.appearance().setBackgroundImage(UIImage(), for: .default)
UINavigationBar.appearance().shadowImage = UIImage()
UINavigationBar.appearance().backgroundColor = UIColor(red: 0.0, green: 0.0, blue: 0.0, alpha: 0.0)
UINavigationBar.appearance().isTranslucent = true
UITabBar.appearance().tintColor = UIColor(red:1.00, green:0.88, blue:0.00, alpha:1.0)
UITabBar.appearance().barTintColor = UIColor.black
UIApplication.shared.statusBarStyle = .lightContent
}
enter image description here
enter image description here