2016-08-03 193 views

回答

1

變化backgroundColorbarTintColor

試試這個

UINavigationBar.appearance().barTintColor = UIColor.blackColor() 
UINavigationBar.appearance().translucent = false 

e.g

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool 
{ 
    UINavigationBar.appearance().barTintColor = UIColor.blackColor() 
    UINavigationBar.appearance().translucent = false 

    return true 
} 

或使用

self.navigationController!.navigationBar.barTintColor = UIColor.blackColor() 
    self.navigationController!.navigationBar.translucent = false 

e.g

override func viewDidLoad() { 
    super.viewDidLoad() 

    self.navigationController!.navigationBar.barTintColor = UIColor.blackColor() 
    self.navigationController!.navigationBar.translucent = false 

     } 
相關問題