JSQMessagesViewController - 为图像消息制作无尾气泡

时间:2018-01-04 22:21:04

标签: objective-c jsqmessagesviewcontroller

我正在尝试使用没有尾部的MediaItem创建一个JSQMessage。

我正在创建消息:

JSQMessage* imageMessage = [JSQMessage messageWithSenderId:fileMessage.sender.userId displayName:senderUser[@"nickname"] media:mediaItem];

但是我没有看到自定义气泡的选项。有没有办法做到这一点?

1 个答案:

答案 0 :(得分:0)

您只需在文件顶部定义气泡样式即可。

        incomingBubble = JSQMessagesBubbleImageFactory(bubble: UIImage.jsq_bubbleCompactTailless(), capInsets: UIEdgeInsets.zero, layoutDirection: UIApplication.shared.userInterfaceLayoutDirection).incomingMessagesBubbleImage(with: UIColor.jsq_messageBubbleBlue())
        outgoingBubble = JSQMessagesBubbleImageFactory(bubble: UIImage.jsq_bubbleCompactTailless(), capInsets: UIEdgeInsets.zero, layoutDirection: UIApplication.shared.userInterfaceLayoutDirection).outgoingMessagesBubbleImage(with: UIColor.lightGray)