【发布时间】:2020-11-21 17:54:36
【问题描述】:
我正在使用 expo 制作一个 react 本机应用程序,并且正在使用 react-native-gifted-chat 进行类似聊天的功能 (https://github.com/FaridSafi/react-native-gifted-chat)。在此功能中,我只希望某些用户能够发送消息。无法查看的用户应该只能查看已发送的消息。
为了实现这一点,我需要一种方法来为无权发送消息的用户隐藏键盘/文本输入。我正在阅读文档,但不确定如何执行此操作。有没有办法隐藏键盘/文本输入并只加载消息?
不确定这是否相关,但我的天才聊天代码如下:
<GiftedChat
messages={this.state.messages}
placeholder="Send your thoughts?"
onSend={(messages) => this.sendMessage(messages)}
user={{
...user details
}}
/>
谢谢!
【问题讨论】:
标签: react-native react-native-gifted-chat