Answers for "how to center vertically scrollview swiftui"

0

how to center vertically scrollview swiftui

/// Custom vertical scroll view with centered content vertically
///
struct VScrollView<Content>: View where Content: View {
  @ViewBuilder let content: Content
  
  var body: some View {
    GeometryReader { geometry in
      ScrollView(.vertical) {
        content
          .frame(width: geometry.size.width)
          .frame(minHeight: geometry.size.height)
      }
    }
  }
}
Posted by: Guest on December-11-2021

Code answers related to "how to center vertically scrollview swiftui"

Code answers related to "Swift"

Browse Popular Code Answers by Language