2017-11-10 33 views
0

私はそれを行う方法を教えてくださいカスタムナビゲーションバーtrasparent Iphone X?ここに私が欲しい画像です。ここに私がしたコードがあります。しかし、私が変更の絵を修正するときは起こらない。透明なナビゲーションバーとステータスバーは普通になりました。私のデータはすべて修正されています。 あなたに追加する必要があるものを教えてもらいました。カスタムナビゲーションバーを更新するtrasparent Image autolayout Iphone X?

私のコード:のViewController

override func viewDidLoad() { 
    super.viewDidLoad() 

    UIApplication.shared.statusBarStyle = .default 


    // Do any additional setup after loading the view. 
} 

AppDelegate.swift

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 


     UINavigationBar.appearance().setBackgroundImage(UIImage(), for: .default) 
     // Sets shadow (line below the bar) to a blank image 
     UINavigationBar.appearance().shadowImage = UIImage() 
     // Sets the translucent background color 
     UINavigationBar.appearance().backgroundColor = UIColor(red: 0.0, green: 0.0, blue: 0.0, alpha: 0.0) 
     // Set translucent. (Default value is already true, so this can be removed if desired.) 

     UINavigationBar.appearance().isTranslucent = true 

     // Override point for customization after application launch. 

     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

答えて

0

はまた、Info.plistファイルにUIStatusBarStyleキーを追加し、動作しませんでした.lightContent

+0

メソッドに値を設定する必要があります。 Info.plistに既にインストールされています。詳細を教えてください – Sandero

関連する問題