Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- UITableView
- ios캡처감지
- parse
- IOS
- Decodable
- swift
- 정보처리기사 실기
- JSONParser
- cocoapods
- ios외부디바이스연결
- cancelstouchesinview
- avcapturesession
- 정보처리기사
- AVFoundation
- Codable
- ios카메라유선연결
- ios캡처방지
- CustomCode
- 2018 KAKAO BLIND RECRUITMENT
- Pod
- 위클리챌린지
- 카메라유선연결
- programmers
- 프로그래머스
- 외부카메라감지
- usb카메라연결
- Xcode
- 정보처리기사 실기 요약본
- JSON
- ios외부카메라연결
Archives
- Today
- Total
iOS 개발일기
[Swift] iOS 15, UINavigationBar barTintColor 적용 방법 본문
iOS 15 업데이트 이후,
navigationController에서 barTintColor 적용이 제대로 이루어지지 않아 iOS15에서 색이 적용되지 않아 투명한 네비게이션바가 보이는 현상이 발견되어 이 문제를 해결하는 방법을 찾아봤습니다.
in AppDelegate didFinishLaunchingWithOptions
if #available(iOS 15.0, *) { //or (iOS 13.0, *)
let appearance = UINavigationBarAppearance()
appearance.backgroundColor = .myColor
UINavigationBar.appearance().standardAppearance = appearance
UINavigationBar.appearance().scrollEdgeAppearance = appearance
} else {
UINavigationBar.appearance().barTintColor = .myColor
}
UINavigationBarAppearance() 함수는 iOS 13 이상에서 사용가능하며
테스트 결과, iOS 15 이상에서는 UINavigationBarAppearance() 함수를 사용해서 네이게이션바에 대한 속성을 지정해주어야 합니다.
예외 적으로 tintColor는 제대로 적용되는 것을 확인했습니다.
참고
https://www.hackingwithswift.com/forums/ios/uinavigation-bar-background-color/444
UINavigation bar background color – iOS – Hacking with Swift forums
Link copied to your pasteboard.
www.hackingwithswift.com
'iOS > Swift' 카테고리의 다른 글
[Swift] Custom PageViewController (0) | 2022.03.22 |
---|---|
[Swift] JSONParser - JSONSerialization (0) | 2022.03.16 |
[Swift] JSONParser - Decodable(2) (0) | 2022.03.15 |
[Swift] JSONParser - Decodable(1) (0) | 2022.03.14 |
[Swift] String.addingPercentEncoding() 특수문자 인코딩하기 (0) | 2021.03.22 |