【发布时间】:2021-12-08 13:03:12
【问题描述】:
我在我的 RN/Expo 应用程序中使用 React-Native-Gifted-Chat。当用户输入消息时,消息框应该随着键盘向上移动。这是我在 iOS 上遇到的行为,但在 Android 上,它掩盖了这个问题。
我尝试在“GiftedChat”道具周围添加一个“KeyboardAvoidingView”,但它会将消息框推到屏幕外。
我也尝试了下面看到的,虽然键盘没有消失,但打字时它仍然覆盖了消息框。
下面是我的代码:
<KeyboardAvoidingView>
<SafeAreaView style = { styles.header }>
<GiftedChat
messages={}
showAvatarForEveryMessage={true}
onSend={messages => onSend(messages)}
user={{
_id:1,
}}
/>
</SafeAreaView>
</KeyboardAvoidingView>
【问题讨论】:
标签: javascript android react-native expo react-native-gifted-chat