跳到主要内容

消息气泡

Global IM UIKit 提供了自定义消息气泡的能力,以满足业务层对消息气泡的定制化需求。

定制化消息气泡

IRCKitMessageBubbleCfg 提供以下属性:

配置项类型默认值说明
radiusNumber8气泡圆角半径。
layoutRCKitBubbleLayoutRCKitBubbleLayout.LEFT_RIGHT气泡布局方式。有效值为 RCKitBubbleLayout.LEFT_RIGHT (左右布局)、RCKitBubbleLayout.LEFT_JUSTIFYING (靠左对齐)。
backgroundColorForMyselfNumber0x0099FF自己发送的消息气泡背景色。
backgroundColorForOthersNumber0xFFFFFF其他人发送的消息气泡背景色。
textColorForMyselfNumber0xFFFFFF自己发送的消息气泡文字颜色。
textColorForOthersNumber0x000000其他人发送的消息气泡文字颜色。
showMyProfileInPrivateConversationBooleantrue在单聊会话中,是否显示自己的头像。
showMyNameInPrivateConversationBooleantrue在单聊会话中,是否显示自己的名称。
showMyProfileInGroupConversationBooleantrue在群聊会话中,是否显示自己的头像。
showMyNameInGroupConversationBooleantrue在群聊会话中,是否显示自己的名称。
showOthersProfileInPrivateConversationBooleantrue在单聊会话中,是否显示他人的头像。
showOthersNameInPrivateConversationBooleantrue在单聊会话中,是否显示他人的名称。
showOthersProfileInGroupConversationBooleantrue在群聊会话中,是否显示他人的头像。
showOthersNameInGroupConversationBooleantrue在群聊会话中,是否显示他人的名称。

获取当前气泡配置

JavaScript
const config = kitApp.cloneMessageBubbleCfg();

更新气泡配置

提示

更新气泡配置仅限于 kitApp.ready() 调用前有效。

JavaScript
kitApp.setMessageBubbleCfg(config);