-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Difference in behavior between iOS 13 and 14 #8
Comments
For anyone that needs this: I figured out that iOS 14 automatically changes the size of a I made the following change to
|
Update for iOS 15: content
.padding(.bottom, self.bottomPadding)
.onReceive(Publishers.keyboardHeight) { keyboardHeight in
let keyboardTop = geometry.frame(in: .global).height - min(0, keyboardHeight) // putting a floor on negative keyboard hight fixes a similar issue on iOS 15
let focusedTextInputBottom = UIResponder.currentFirstResponder?.globalFrame?.maxY ?? 0
self.bottomPadding = max(0, focusedTextInputBottom - keyboardTop)
}
.animation(.easeOut(duration: 0.25)) |
view is getting scrolled bit more..if the view is complex |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The screenshot shows two simulators for iPhone 8: one running iOS 13.7 and the other 14.4. The code is identical between them, run from Xcode directly. I have verified the same behavior on a physical iOS 14 device.
In case it matters, the text field is actually hidden, and is in a
ZStack
with the button on the bottom, to make sure it forces the button to move up above the keyboard. During normal operation, the keyboard is never hidden, though of course we can do so in the simulator.The text was updated successfully, but these errors were encountered: