App Store에서 미리보기 저 스크롤은 페이지 스크린샷 만큼씩만 페이지가 넘어간다.
TabView로 구성하면 될까 싶었지만
TabView는 한 페이지에 1개씩 밖에 안된다. 저렇게 반쯤 걸쳐져 있는 것은 구현이 안된다.
ScrollView(.horizontal) {
HStack {
ForEach(0..<4) {
Image("kakaoBankScreenShot\($0)")
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: imageWidth)
}
}
.padding(.horizontal, horizontalPadding)
.scrollTargetLayout()
}
.scrollIndicators(.never)
.scrollTargetBehavior(.viewAligned)
방법은 .scrollTargetBehavior(.viewAligned)
.scrollTargetLayout()
이다
해당 방법을 통해서 원하는 크기 만큼씩 Scroll을 조절할 수 있다.
'SwiftUI' 카테고리의 다른 글
[SwiftUI / MVI 패턴] MVI 패턴의 변화 ( iOS 17+ ) - 2탄 (2) | 2025.06.07 |
---|---|
[SwiftUI / MVI 패턴] MVI 패턴의 변화 ( iOS 17+ ) (0) | 2025.06.07 |
[SwiftUI] GeometryReader로 반응형 화면 만들기 (0) | 2025.05.10 |
[SwiftUI] SearchBar in Navigation (0) | 2025.05.09 |