반응형
방법
두가지 방법이 있지만 첫번째 방법은 권장하지 않음
앱 전체에 대해 설정
- info.plist -
View controller-based status bar appearance
- NO - AppDelegate 에 아래 코드 작성
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { application.statusBarStyle = .lightContent // .default return true }
각 뷰 컨트롤러에 대해 설정
- Defalut 는 No (그러나 위에서 info.plist를 건들였다면 를
View controller-based status bar appearance
없애거나 YES로 변경) - 뷰 컨트롤러에 아래 코드 작성
override var preferredStatusBarStyle: UIStatusBarStyle { return .lightContent // .default }
참고
preferredStatusBarStyle - UIViewController | Apple Developer Documentation
setStatusBarStyle(_:animated:) - UIApplication | Apple Developer Documentation
반응형
'Swift' 카테고리의 다른 글
프로토타입 셀 제어 (0) | 2018.11.04 |
---|---|
이미지 사용 용도에 따른 UIImage 생성자 선택 (0) | 2018.11.04 |
@IBAction, 뷰끼리 값전달, 델리게이트, 최초 응답자 간단한 정보 (0) | 2018.11.04 |
*.pbxproj 삭제 했을 때 대처하는 방법 (0) | 2018.11.03 |
Switch 사용하면서 값이 배열 안에 있는지 확인하는 방법 (0) | 2018.11.03 |