0

我会将头像移动到左侧气泡消息的右侧和右侧气泡消息的左侧,就像示例一样:

在此处输入图像描述

4

1 回答 1

2

我只是自己想通了。这是解决方案:

创建一个 const 来编辑Message样式组件

const customMessage = props => {
return(
<Message
{...props}
containerStyle={{
left: {
flexDirection: 'row-reverse'
},
right: {
flexDirection: 'row-reverse'
}
}}
/>
)
}

然后将 props 添加到GiftedChat组件中:

<GiftedChat 
renderMessage={props => customMessage(props)}
/>
于 2020-04-13T15:53:52.967 回答