我无法修改NavigationController,我的代码有什么问题吗?

时间:2017-03-09 10:41:46

标签: ios swift cosmicmind

import UIKit
import SwiftyDrop
import Material

class HomePageView: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        self.view.backgroundColor = Color.blue.base
        self.navigationItem.title = "test"
        self.navigationItem.titleLabel.textColor = .black
        self.navigationItem.detail = "Build an app"
    }

    func pushSelf () {
        self.navigationController?.pushViewController(SecondPageView(), animated: true)
    }

    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        preparePageTabBarItem()
    }

    init() {
        super.init(nibName: nil, bundle: nil)
        preparePageTabBarItem()
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()

    }
}

extension HomePageView {
    fileprivate func preparePageTabBarItem() {
        pageTabBarItem.title = "Blue"
        pageTabBarItem.titleColor = Color.blueGrey.base

    }
}

我在我的ViewController中使用这些代码来修改NavigationController,但它保持空白并且根本没有改变,我不能巧妙地使用Material,所以我想知道你是否可以给我一些建议。 enter image description here

0 个答案:

没有答案