본문 바로가기
IOS

[iOS] 화면전환시 StatusBar 회색으로 깜박임 현상 해결하기

by eigen96 2022. 10. 11.
728x90

비슷한 사례)

https://stackoverflow.com/questions/58854175/grey-background-in-navigation-bar-with-searchcontroller-added-to-navigationitem

 

Grey background in navigation bar with searchController added to navigationItem during push

I have a table view in navigation controller so that I can push the detail view controller on the stack. It works fine, until I add a search controller to the navigation item, like so: searchContr...

stackoverflow.com

 

상황)  프로젝트 작업 중 Quality Control 요청이 들어왔습니다.

게시물 목록 화면에서 게시글 상세로 진입할 경우 네비게이션 바 색상이 잠깐 동안 회색으로 변하는 상황이었는데요.

백그라운드 화면과 해당 뷰컨트롤러의 navigationBar의 backgroundColor를 설정해주어도 최상단의 상태바는 회색깜박임이 여전히 발생하였습니다. 

뷰컨트롤러를 push할 때 animation을 false로 설정해주면 해결되긴 하지만 클라이언트 측에서 애니메이션 효과를 원하고 있기에 그렇게 해결할 수는 없었습니다.

 

해결) windowScene의 statusBarManager을 이용해서 StatusBar 백그라운드를 직접 설정하여 해결.

 

참고)

https://growup-lee.tistory.com/entry/Swift-Status-Bar-Background-Color-%EB%B3%80%EA%B2%BD

 

[Swift] Status Bar Background Color 변경

개요 status bar의 배경 색상을 변경해보자 Status Bar 배경색 변경 iOS 13부터는 windowScene의 statusBarManager을 이용해서 status bar의 배경색을 변경할 수 있다. 색상을 변경하는 코드는 아래와 같다. func..

growup-lee.tistory.com

 

 

728x90

댓글