I'm trying to get the height of the keyboard in order to scroll my view when it appears. The keyboardDidShow event works perfectly in IOS, and the height value of the coordinates takes into account the extra bit that appears at the top of the keyboard when autoCorrect is on.
this.keyboardShowListener = DeviceEventEmitter.addListener(
'keyboardDidShow', this.keyboardDidShow);
...
keyboardDidShow (e) {
let keyboardHeight = e.endCoordinates.height;
this.refs.mainScrollView.scrollTo(
{x: 0, y: keyboardHeight, animated: true});
},
However, in Android (with NR 0.21.0) it looks like the value given for the height doesn't include the extra auto-correct component height, and so when I scroll it comes up a bit short.
Now I could just add on some value for android, but that doesn't seem like a good solution. Can you be sure it works on every android keyboard? I suspect not.
So, is there a way to get a handle on the keyboard object in order to measure it?