2017-06-15
1:使用keyVoaidView来解决 注意要设置behavio=“absolute”,哎。记性差 好像拼错了
2:使用下面的代码,监听键盘,然后将webView拉高就可以了
import React, { Component } from 'react'; import { Keyboard, TextInput } from 'react-native'; class Example extends Component { componentWillMount () { this.keyboardDidShowListener = Keyboard.addListener('keyboardDidShow', this._keyboardDidShow); this.keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', this._keyboardDidHide); } componentWillUnmount () { this.keyboardDidShowListener.remove(); this.keyboardDidHideListener.remove(); } _keyboardDidShow () { alert('Keyboard Shown'); } _keyboardDidHide () { alert('Keyboard Hidden'); } render() { return ( <TextInput onSubmitEditing={Keyboard.dismiss} /> ); } }