我正在使用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
}}
/>谢谢!
发布于 2020-08-01 09:57:47
只需为prop renderInputToolbar传递null
<GiftedChat
...
renderInputToolbar={() => { return null }}
/>发布于 2020-09-12 23:40:31
将minInputToolbarHeight属性设置为零:
<GiftedChat
...
minInputToolbarHeight=0
/>https://stackoverflow.com/questions/63199386
复制相似问题