Patch for IQKeyboardManager issue.

This commit is contained in:
Rossen Hristov
2015-11-05 14:46:35 +02:00
parent ca729e4ce0
commit dec5d971f3
3 changed files with 23 additions and 8 deletions

View File

@@ -233,6 +233,17 @@ export class Frame extends frameCommon.Frame {
var navigationBar = this._ios.controller.navigationBar;
return (navigationBar && !this._ios.controller.navigationBarHidden) ? navigationBar.frame.size.height : 0;
}
public _setNativeViewFrame(nativeView: UIView, frame: CGRect) {
// HACK: The plugin https://github.com/hackiftekhar/IQKeyboardManager offsets our Frame's 'nativeView.frame.origin.y'
// to a negative value so the currently focused TextField/TextView is always on the screen while the soft keyboard is showing.
// Our Frame always wants to have an origin of {0, 0}, so if someone else has been playing with origin.x or origin.y do not bring it back to {0, 0}.
if (nativeView.frame.size.width === frame.size.width && nativeView.frame.size.height === frame.size.height) {
return;
}
super._setNativeViewFrame(nativeView, frame);
}
}
class UINavigationControllerImpl extends UINavigationController implements UINavigationControllerDelegate {