测试已测试 | ✗ |
语言语言 | SwiftSwift |
许可 | MIT |
发布最后发布 | 2016年7月 |
SPM支持 SPM | ✗ |
由 litt1e-p维护。
通过运行时和 Swift 动态改变 UIStatusBar 的 backgroundColor
pod 'LPStatusBarBackgroundColor-swift', '~> 1.0.0'
Objective C 版本在这里:这里
//import
import LPStatusBarBackgroundColor_swift
//set navigationBar's backgroundImage with height 44
navigationController!.navigationBar.setBackgroundImage(UIImage.imageWithColor(yourColor, size: CGSizeMake(
UIScreen.mainScreen().bounds.size.width
, 44)), forBarPosition: UIBarPosition.Any, barMetrics: UIBarMetrics.Default)
/** in navigationController */
self.navigationBar.statusBarBackgroundColor = UIColor.blackColor() //any color you want
/** in navigationController's rootViewController */
self.navigationController?.navigationBar.statusBarBackgroundColor = UIColor.brownColor //any color you want
MIT