某些标签页上的iOS导航栏更亮

时间:2015-11-03 10:08:51

标签: ios swift uinavigationcontroller

导航栏我没什么问题。

在某些标签上它较暗但有些较亮。

我为两个使用相同的导航视图控制器类。

import UIKit

class NavigationViewController: UINavigationController {

    override func viewDidLoad() {
        super.viewDidLoad()

        let backBtnTitle = UIBarButtonItem(title: "", style: .Plain, target: nil, action: nil)
        navigationBar.topItem?.backBarButtonItem = backBtnTitle

        navigationBar.barTintColor = UIColor(red:0.12, green:0.6, blue:0.64, alpha:1)
        navigationBar.tintColor = UIColor.whiteColor()
        navigationBar.barStyle = .Black
        let attributes = [
            NSFontAttributeName: UIFont(name: "HelveticaNeue-Light", size: 24)!,
            NSForegroundColorAttributeName: UIColor.whiteColor()
        ]
        navigationBar.titleTextAttributes = attributes

    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
    }

}

你可以在这张图片上看到: enter image description here

我怎样才能解决这个问题,两者都变得颜色较深?

1 个答案:

答案 0 :(得分:4)

解决方案:

self.navigationBar.translucent = false
导航视图控制器中的