Answers for "scroll view swiftui"

-2

scrollview swift

//We can use the ScrollView struct in SwiftUI which allows us to scroll down
//Declaration:

struct ScrollView<Content> where Content : View

//Example of ScrollView
ScrollView {
 	VStack  {
      ForEach(0..<100) {
        Text("Row ($0)")
      }
    }
  }
}

//Let's say here, we have 100 text views. Without the scroll view, we would not be able to see all 100 text views.
//However, this is exactly what the scroll view enables us to do
Posted by: Guest on August-13-2021

Code answers related to "Swift"

Browse Popular Code Answers by Language