對於非 UINavigationBar 狀態列
- 在 info.plist 中將
View controller-based status bar appearance設定為YES - 在檢視中,
UINavigationController不包含的控制器實現此方法。
在 Objective-C 中:
- (UIStatusBarStyle)preferredStatusBarStyle
{
return UIStatusBarStyleLightContent;
}
在 Swift 中:
override func preferredStatusBarStyle() -> UIStatusBarStyle {
return UIStatusBarStyle.LightContent
}