AppDelegate

1.NavigationBar的设置

UINavigationBar.appearance().tintColor = UIColor.white
let dict:NSDictionary = [NSForegroundColorAttributeName: UIColor.white,NSFontAttributeName : UIFont.boldSystemFont(ofSize: 18)]
UINavigationBar.appearance().titleTextAttributes = dict as? [String : AnyObject]
UINavigationBar.appearance().isTranslucent = false
UINavigationBar.appearance().barTintColor = UIColor.customPurple()

2.页面跳转

extension AppDelegate {
    func showMainView(){
        let vc = UIStoryboard.init(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "main") as! ViewController
        
        self.window = UIWindow(frame: UIScreen.main.bounds)
        self.window?.backgroundColor = UIColor.white
        self.window?.rootViewController = vc
        self.window?.makeKeyAndVisible()
    }
}
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 发现 关注 消息 iOS 第三方库、插件、知名博客总结 作者大灰狼的小绵羊哥哥关注 2017.06.26 09:4...
    肇东周阅读 12,196评论 4 61
  • 前言: 在实际开发中,我们经常会遇到需在应用启动时,越过首页,直接跳转到指定页的操作,主要分为点击应用桌面图标进入...
    木马sun阅读 1,936评论 2 2
  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 172,939评论 25 708
  • 这寸窗户中有四个颜色:黑色、深咖啡色、橙色、黄色。 黑色分两块,其中一块几乎占据整扇窗户的1/2在窗户下部,另一小...
    _月牙弯弯阅读 317评论 0 0
  • 译者:达仔Zhangjd原文地址:如何学习React 如果你是一个 React (或者前端) 新手,出于以下的原因...
    IT程序狮阅读 1,127评论 0 19