swift-修改导航的背景和字体颜色,tabbar的选中字体颜色

override func viewDidLoad() {

        super.viewDidLoad()

        let controller1 = ViewController()

        let navigation = UINavigationController(rootViewController:controller1)

        controller1.title = "123"

        controller1.navigationController?.navigationBar.barTintColor = UIColor.greenColor()

        let navigationDic = [NSForegroundColorAttributeName : UIColor.whiteColor()]

        controller1.navigationController?.navigationBar.titleTextAttributes = navigationDic

        let controller2 = UIViewController()

        controller2.view.backgroundColor = UIColor.redColor();

        self.addChildViewController(navigation)

        self.addChildViewController(controller2)

        controller1.tabBarItem.title = "111"

        controller2.tabBarItem.title = "222"

        tabBar.tintColor = UIColor.redColor()

        

        

    }


阅读更多
个人分类: swift
上一篇Swift -UIButton和UIImageView的用法
下一篇url直接转化成image,将字符串复制到粘贴板,验证邮箱
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭