标签:set ima await boa move lis nim mount dshow
componentWillUnmount() {
this.keyboardDidShowListener.remove();
this.keyboardDidHideListener.remove();
}
componentWillMount() {
this.keyboardDidShowListener = Keyboard.addListener(‘keyboardDidShow‘, this._keyboardDidShow.bind(this));
this.keyboardDidHideListener = Keyboard.addListener(‘keyboardDidHide‘, this._keyboardDidHide.bind(this));
}
_keyboardDidShow(e) {
async function run(self) {
await self.setState({
keyboardHeight: e.endCoordinates.height
});
self.refs.scroll.scrollTo({
x: 0, y: self.state.keyboardHeight, animated: true
})
}
run(this);
}
_keyboardDidHide(e) {
this.setState({
keyboardHeight: 0
})
}
标签:set ima await boa move lis nim mount dshow
原文地址:http://www.cnblogs.com/dragonh/p/7485553.html