0

I am using SwiftUI to create screen, I am adding few TextFields on ScrollView in body and the problem is when I tap last TextField and keyboard appear, it cover textField that I am editing, so my question is: Is there any way in SwiftUI to update ScrollView inset when keyboard appear?

I've tried to use List but that didn't work

Some code example:

var body: some View {
        ScrollView {
            Text("SomeParameter1")
            TextField("", text: $text)
                .textFieldStyle(RoundedBorderTextFieldStyle())
            Text("SomeParameter2")
            TextField("", text: $text)
                .textFieldStyle(RoundedBorderTextFieldStyle())
            Text("SomeParameter3")
            TextField("", text: $text)
                .textFieldStyle(RoundedBorderTextFieldStyle())
            Text("SomeParameter4")
            TextField("", text: $text)
                .textFieldStyle(RoundedBorderTextFieldStyle())
        }
    }
savmex
  • 311
  • 1
  • 4
  • 8
  • [this](https://stackoverflow.com/questions/56491881/move-textfield-up-when-thekeyboard-has-appeared-by-using-swiftui-ios/57235093#57235093) Q&A is not about lists specifically, but the solutions provided there may work for you. – Benjamin Kindle Sep 09 '19 at 17:32
  • Possible duplicate of [Move TextField up when thekeyboard has appeared by using SwiftUI? : iOS](https://stackoverflow.com/questions/56491881/move-textfield-up-when-thekeyboard-has-appeared-by-using-swiftui-ios) – Benjamin Kindle Sep 09 '19 at 17:32

0 Answers0