标签:androi get from board render react 输入 遮挡输入框 ret
Android上已经自动对键盘遮挡输入框做了处理,所以我们只需要关注ios。
import { KeyboardAvoidingView } from 'react-native';
render(){
return <KeyboardAvoidingView behavior={'padding'} style={{flex: 1}}>
{/*具体页面内容*/}
</KeyboardAvoidingView>
}
getPageView = () => {
//return 具体页面内容
}
getPlatformView = () => {
if (Platform.OS === 'ios') {
return <KeyboardAvoidingView behavior={'padding'} style={{flex: 1}}>
{this.getPageView()}
</KeyboardAvoidingView>
} else {
return this.getPageView();
}
};
render() {
return this.getPlatformView();
}
标签:androi get from board render react 输入 遮挡输入框 ret
原文地址:https://www.cnblogs.com/bygw/p/11327141.html