Skip to content

Commit

Permalink
- Fixed an issue where textView is at the bottom of iPhone X or on a …
Browse files Browse the repository at this point in the history
…tabBarController where offsets are getting wrong
  • Loading branch information
hackiftekhar committed Jul 18, 2018
1 parent cd7b5ce commit ee05169
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
Binary file not shown.
2 changes: 1 addition & 1 deletion IQKeyboardManager/IQKeyboardManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ -(void)adjustPosition
CGFloat layoutAreaHeight = rootController.view.layoutMargins.top;

CGFloat topLayoutGuide = MAX(navigationBarAreaHeight, layoutAreaHeight) + 5;
CGFloat bottomLayoutGuide = rootController.view.layoutMargins.bottom;
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.

// +Move positive = textField is hidden.
// -Move negative = textField is showing.
Expand Down
2 changes: 1 addition & 1 deletion IQKeyboardManagerSwift/IQKeyboardManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,7 @@ public class IQKeyboardManager: NSObject, UIGestureRecognizerDelegate {
let layoutAreaHeight : CGFloat = rootController.view.layoutMargins.bottom

let topLayoutGuide : CGFloat = max(navigationBarAreaHeight, layoutAreaHeight) + 5
let bottomLayoutGuide : CGFloat = rootController.view.layoutMargins.bottom
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.

// Move positive = textField is hidden.
// Move negative = textField is showing.
Expand Down

1 comment on commit ee05169

@chaiweiwei
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UITextField also need fix this bug

Please sign in to comment.