设置导航栏颜色, 字体大小
2020-12-02 本文已影响0人
zwwuchn
取出导航栏
let bar = UINavigationBar.appearance()
设置导航栏背景色
bar.barTintColor = .white
设置标题颜色和字体大小
bar.titleTextAttributes = [NSAttributedString.Key.font:UIFont.boldSystemFontOfSize(18),NSAttributedString.Key.foregroundColor:UIColor.whiteColor()]
设置布局从导航栏下开始, 把导航栏设置为不透明
bar.isTranslucent = false
bar.shadowImage = UIImage()
设置状态栏的字体和图标的颜色为白色
UIApplication.sharedApplication().setStatusBarStyle(UIStatusBarStyle.LightContent, animated: true)