如何在Reaction Native中更改GetStream自身/当前气泡消息的背景 colored颜色 ?

const theme = {
  messageSimple: {
    content: {
      container: {
        backgroundColor: 'purple',
      },
    },
    file: {
      container: {
        backgroundColor: 'purple',
      },
    },
  },
};


<OverlayProvider value={{ style: theme }}>
    <Chat client={client}>
      <ChannelList />
    </Chat>
  </OverlayProvider>

不幸的是,什么都不起作用,我找不到关于它的文档和帖子,至少在RN中是这样.

Need to change the gray bubble and text color but the above code resulted to this. enter image description here

推荐答案

我有一个确切的问题,找到了你的帖子,很失望你没有得到回答,所以找到了我们两个的解决方案!你们真的很接近了.在您的主题中,messageSimple->;content中应该是textContainer而不是container.以下是代码和结果的屏幕截图

enter image description here

enter image description here

如果您愿意,您还可以通过创建一个主题并将其作为myMessageTheme传递给Channel来单独定制当前用户的消息,它将仅覆盖该用户的主题的指定部分.

enter image description here

Chat bubble with blue background

希望这能有所帮助!:)

https://getstream.io/chat/docs/sdk/reactnative/guides/message-customization/#message-bubble-with-custom-text-styles--fonts

https://getstream.io/chat/docs/sdk/reactnative/core-components/channel/#mymessagetheme

React-native相关问答推荐

Reaction-Native-pdf文件不是PDF格式或已损坏

文本输入提示

React Native - 为什么我们对 Image 组件使用 tintColor 属性?

按下按钮有一个borderRadius

React-Native:无法从我的 android 应用程序打开设备设置

React Native:在 ScrollView contentContainerStyle 上设置 flex:1 会导致组件重叠

React Native 入门元素Bundle 失败,出现 Unexpected Token 错误

React-native android 样式化 textInput

React Navigation 5 隐藏Drawer抽屉元素

react Navigation 在标题中使用图像?

在 React Native 中使用多个上下文提供程序的更好方法

将 svg 转换为 react-native-svg

词法或预处理器问题 - 未找到 event2/event-config.h 文件

React Native:组件卸载时的动画

react-native 自动完成文本输入

React-native:图像未显示在 android 设备中,但在模拟器中完美显示

React Native - 为什么执行这个函数?

使用 React Native 运行 Firebase 3.0 时出错

列之间的 React Native FlatList 分隔符

react-native 开始给出 Invalid 正则表达式无效错误