[iOS] 스플래시 화면이 찌그러지는 문제

profile image pIutos 2023. 11. 22. 07:00

 

문제점

앱 접근시 아래와 같이 splash screen이 xcode에서 작성한대로 표시가 되지 않고 로고(png)가 원래 사이즈대로 표시되는 문제가 발생했습니다.

해결방안

1. 로고 이미지의 하단에 'Add New Constraints' 버튼을 클릭합니다.

2. 간격을 모두 0으로 설정한 다음, 'Constrain to margins' 버튼을 선택 해제한 후 Add 4 Constraints 버튼을 눌러 새 Constraint를 생성합니다.

3. constrains의 trailing, leading의 기준을 safe area로 설정하고, 마찬가지로 Top, Bottom의 기준을 superView로 설정합니다.

4. 마지막으로 전체 View의 Content Mode를 'Scale To Fill'로 설정합니다.

앞선 방법대로 설정을 완료했다면 의도한대로 splash screen이 표시됩니다.

참고링크

https://github.com/aparajita/capacitor-splash-screen/issues/8 

https://stackoverflow.com/questions/65008327/my-launch-screen-image-has-a-wrong-size-on-small-screens

아래 링크는 스플래시 이미지를 만들고 적용하는 방법에 대해 자세히 설명한 글이니 참고해주세요.

https://staktree.github.io/ios/IOS-splash-01/