Skip to content

Commit ee05169

Browse files
committed
- Fixed an issue where textView is at the bottom of iPhone X or on a tabBarController where offsets are getting wrong
1 parent cd7b5ce commit ee05169

File tree

3 files changed

+2
-2
lines changed

3 files changed

+2
-2
lines changed

IQKeyboardManager/IQKeyboardManager.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ -(void)adjustPosition
642642
CGFloat layoutAreaHeight = rootController.view.layoutMargins.top;
643643

644644
CGFloat topLayoutGuide = MAX(navigationBarAreaHeight, layoutAreaHeight) + 5;
645-
CGFloat bottomLayoutGuide = rootController.view.layoutMargins.bottom;
645+
CGFloat bottomLayoutGuide = [textFieldView isKindOfClass:[UITextView class]] ? 0 : rootController.view.layoutMargins.bottom; //Validation of textView for case where there is a tab bar at the bottom or running on iPhone X and textView is at the bottom.
646646

647647
// +Move positive = textField is hidden.
648648
// -Move negative = textField is showing.

IQKeyboardManagerSwift/IQKeyboardManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,7 @@ public class IQKeyboardManager: NSObject, UIGestureRecognizerDelegate {
992992
let layoutAreaHeight : CGFloat = rootController.view.layoutMargins.bottom
993993

994994
let topLayoutGuide : CGFloat = max(navigationBarAreaHeight, layoutAreaHeight) + 5
995-
let bottomLayoutGuide : CGFloat = rootController.view.layoutMargins.bottom
995+
let bottomLayoutGuide : CGFloat = (textFieldView is UITextView) ? 0 : rootController.view.layoutMargins.bottom //Validation of textView for case where there is a tab bar at the bottom or running on iPhone X and textView is at the bottom.
996996

997997
// Move positive = textField is hidden.
998998
// Move negative = textField is showing.

0 commit comments

Comments
 (0)