0

I found this answer great for views but for a scrollview it works with this half text view height effect:

enter image description here

Is this something I can do with this KeyboardAwareSwiftUI classes? I tried to play with magical numbers to increase this values here:

  func body(content: Content) -> some View {
        content
            .padding(.bottom, self.keyboard.height + 100)
            .edgesIgnoringSafeArea(self.keyboard.height > 0 ? .bottom : [])
            .animation(.easeOut)
    }

but this just increased some area above the keyboard but text view is still hidden a bit:

enter image description here

Matrosov Oleksandr
  • 25,505
  • 44
  • 151
  • 277

1 Answers1

0

I would recommend using this library instead, and you never have to worry about view positioning when keyboard is shown: https://github.com/hackiftekhar/IQKeyboardManager

It's a non swiftui library, however, this issue here shows how to add it to your swiftui app seamlessly and only a few line of code: https://github.com/hackiftekhar/IQKeyboardManager/issues/1606

hope this helps

BokuWaTaka
  • 168
  • 6