首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在React-Native-Gifted-Chat中删除键盘和作曲家之间的空格

在React-Native-Gifted-Chat中删除键盘和作曲家之间的空格
EN

Stack Overflow用户
提问于 2021-01-05 19:26:53
回答 2查看 675关注 0票数 0

我正在为我的React Native应用程序使用React-Native-gifted chat包。不知何故,作曲家和键盘之间有一个空格,尽管我没有定制GiftedChat。

附加屏幕截图中标记为橙色:

我已经尝试自定义作曲器或任何其他组件,但没有效果。

EN

回答 2

Stack Overflow用户

发布于 2021-05-12 15:04:53

一段时间后,我也面临着同样的问题,我找到了这个解决方案,它对我来说是有效的。

代码语言:javascript
复制
     <GiftedChat
                    isAnimated
                    messages={this.state.messages}
                    scrollToBottom={true}
                    renderUsernameOnMessage={true}
                    onSend={messages => this.onSend(messages)}
                    inverted={false}
                    isLoadingEarlier={true}
                    messagesContainerStyle={{ color: 'gray' }}
                    bottomOffset={0} // add this line and space is remove
                    renderBubble={props => {
                        return (
                            <Bubble
                                {...props}

                                textStyle={{
                                    right: {
                                        color: 'white',
                                    },
                                    left: {
                                        color: '#24204F',
                                    },
                                }}
                                wrapperStyle={{
                                    left: {
                                        backgroundColor: 'white',
                                    },
                                    right: {
                                        backgroundColor: "#ff3b00", // red
                                    },
                                }}
                            />
                        );
                    }}
                    renderInputToolbar={props => {
                        return (<InputToolbar {...props} containerStyle={{ backgroundColor: '#e2e2e2' }} />);
                    }}
                    user={{
                        _id: 1
                    }}
                />

希望这将为您工作bottomOffset={0} //添加此行并删除空格

票数 1
EN

Stack Overflow用户

发布于 2021-01-20 21:00:49

安装react-native-iphone-x-helper

并根据您的代码添加这些行。

代码语言:javascript
复制
import { getBottomSpace } from 'react-native-iphone-x-helper';



<GiftedChat 
    bottomOffset={getBottomSpace()}
    ...
/>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65577984

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档