[iOS] 화면전환 전체화면 하는법

PM077·2023년 2월 19일
0

iOS

목록 보기
15/21

개요

화면 전환 시 위쪽에 여백이 남는 방식이 기본 방식이기에 이를 설정해줘야 한다.

해결방법

ViewController으로 전환 시

let detailVC = DetailViewController()
detailVC.modalPresentationStyle = .fullScreen
present(detailVC, animated: true)
let detailVC = DetailViewController()
let navigationController = UINavigationController(rootViewController: detailVC)
navigationController.modalPresentationStyle = .fullScreen
present(navigationController, animated: true)

이런식으로 .fullScreen 을 해주면 전체화면을 해줄 수 있다.
.automatic 은 위에 여백이 남는 방식

.
.
.
.
.

참고자료

https://zonneveld.dev/ios-13-viewcontroller-presentation-style-modalpresentationstyle/

profile
PM/PO

0개의 댓글