Jinsujin / SwiftUI

SwiftUI를 공부해보고 활용하는 공간
0 stars 0 forks source link

ScrollView #5

Closed Jinsujin closed 1 year ago

Jinsujin commented 1 year ago

문서 바로가기

Declaration

init(
    _ axes: Axis.Set = .vertical,
    showsIndicators: Bool = true,
    content: () -> Content
)

예제

컨텐츠 가로 스크롤하기

ScrollView(.horizontal) {
    HStack {
        Text("1")
            .frame(width: 300, height: 500)
            .background(.red)
        Text("2")
            .frame(width: 300, height: 500)
            .background(.orange)
        Text("3")
            .frame(width: 300, height: 500)
            .background(.blue)
    }
}.background(.gray)