React-native 关于键盘遮挡界面问题

//引入 KeyboardAvoidingView 
import { KeyboardAvoidingView } from 'react-native';

//使用 KeyboardAvoidingView 
render(){
    return <KeyboardAvoidingView behavior={'padding'} style={{flex: 1}}>
        {/*具体页面内容*/}
    </KeyboardAvoidingView>
}

//android 已经处理 其实只需要处理Ios 就可以了  

但是有个问题 当使用scrollView  时,再其中的元素依旧会被遮挡,需要注意

通常在框架搭建之初就应该添加适配写法

 

posted @ 2019-10-21 11:02  雨中伞  阅读(769)  评论(0编辑  收藏  举报