samsung-ga / woody-iOS-tip

🐶 iOS에 대한 소소한 팁들과 개발하다 마주친 버그 해결기, 그리고 오늘 배운 것들을 모아둔 레포
19 stars 0 forks source link

[TIL] SwiftUI ScrollView / List 에서 content offset 주는 방법 #19

Open samsung-ga opened 2 years ago

samsung-ga commented 2 years ago

ScrollView와 List에서 content offset을 주는 방법

  1. (야매) EmptyView() 또는 Color.clear를 배치
            ScrollView(.vertical, showsIndicators: true) {
                EmptyView().frame(height: 50)
                Pallete.backgroundGray.color
                    .frame(height: 1000)
            }
            .background(Pallete.backgroundGray.color)
  2. padding주기
            List {
                ForEach(0..<4) {_ in
                    HomeTossBankButton()
                }
            }
            .background(Pallete.backgroundGray.color)
            .padding(.top, 50)