2

I'm having some issues surrounding disabling keyboard avoidance in SwiftUI. My app has a custom tab bar which sits in a VStack underneath the content of the root view. However, most of my views have ScrollViews in them. When the keyboard is open it pushes the tab bar above the keyboard, even when using .ignoresSafeArea(.keyboard, .bottom).

Essentially:

//in RootView.swift
VStack {
    ScrollView {
        TextField($entry, text: "Placeholder")
    }

    TabBarView()
        .ignoresSafeArea(.keyboard, .all)
}

In this code, when the keyboard is open it would push the TabBarView above the keyboard, reducing the size of the scroll view. I imagine this is something to do with the scroll view not really having a defined size - and instead taking up all the available space.

What would the solution be here?

Thanks!

jed-boffey
  • 95
  • 1
  • 6

0 Answers0