카테고리 없음

Catcher 트러블슈팅

jjjkh 2023. 11. 14. 22:23
  • 문제 상황 

        - 작업한 페이지에 스크롤뷰를 넣지 않아 iPhone SE에서 화면이 잘리는 현상

iPhone SE에서 화면이 잘리는 현상

 

  • 수정 및 조치 

        - 페이지를 구성하는 컴포넌트들을 스크롤뷰에 넣어 스크롤이 가능하게 하여 문제 해결

 lazy var scrollView: UIScrollView = {
        let vw = UIScrollView()
        vw.addSubview(contentView)
        return vw
    }()
 func setLayout() {
     scrollView.snp.makeConstraints { make in
            make.top.equalTo(self.safeAreaLayoutGuide).offset(AppConstraint.headerViewHeight)
            make.leading.trailing.equalToSuperview()
            make.bottom.equalTo(self.safeAreaLayoutGuide.snp.bottom)
        }
        //contentView 모든 컴포넌트를 포함하는 view
        contentView.snp.makeConstraints { make in
            make.edges.equalTo(scrollView.contentLayoutGuide)
            make.width.equalTo(scrollView.frameLayoutGuide)
            make.centerX.equalToSuperview()
        }
        }