KeyboardAvoidingView在选项卡导航中不起作用

时间:2019-12-20 13:53:38

标签: reactjs react-native

我在react native中使用内置的KeyboardAvoidingView,并且当我在屏幕上看不到选项卡的情况下(例如模式中)使用下面的代码时,它工作得很好并且键盘无法覆盖任何内容,但是当我使用完全相同的代码但在选项卡导航中使用的屏幕中时,键盘覆盖了某些内容,就像KeyboardAvoidingView并未考虑底部选项卡的高度

这是我的代码:

<KeyboardAvoidingView style={{flex: 1}} behavior="padding">
    <ScrollView keyboardShouldPersistTaps="handled">
        {content}
    </ScrollView>
    <TextInput 
        style={{height: 50, width: "100%", backgroundColor: "red"}}
        placeholder="Test input"
    />
</KeyboardAvoidingView>

0 个答案:

没有答案
相关问题