スクロールした時とかに曇りガラスにしたくない時に使う方法
通常何もしなければ、ナビゲーションバーの下にあるものは、曇りガラスが適用されてボケて見える。
AppDelegate.swift
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
internal var window: UIWindow?
private var navigationController: UINavigationController!
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
let viewController: ViewController = ViewController()
navigationController = UINavigationController(rootViewController: viewController)
self.navigationController?.navigationBar.tintColor = UIColor.whiteColor()
// 下記の1行を追加する
self.navigationController?.navigationBar.barTintColor = UIColor.whiteColor()
// self.navigationController?.navigationBar.translucent = false
self.window = UIWindow(frame: UIScreen.mainScreen().bounds)
self.window!.rootViewController = navigationController
self.window!.backgroundColor = UIColor.whiteColor()
self.window!.makeKeyAndVisible()
return true
}
func applicationWillResignActive(application: UIApplication) {}
func applicationDidEnterBackground(application: UIApplication) {}
func applicationWillEnterForeground(application: UIApplication) {}
func applicationDidBecomeActive(application: UIApplication) {}
func applicationWillTerminate(application: UIApplication) {}
}