答案 0 :(得分:0)
Ya只是为tailessBubble创建一个变量,库中包含一个无穷无尽的气泡图像资源
let tailessIncomingBubble = JSQMessagesBubbleImageFactory(bubble: UIImage(named: "tailessMessageBubble"), capInsets: UIEdgeInsets.zero).incomingMessagesBubbleImage(with: WeaveColor.Grey.incomingBubble)
然后只需覆盖messageBubbleImageDataForItemAt
方法
override func collectionView(_ collectionView: JSQMessagesCollectionView!, messageBubbleImageDataForItemAt indexPath: IndexPath!) -> JSQMessageBubbleImageDataSource! {
let currentMessage = messages[safe: indexPath.item]
return firstMessageInSet(indexOfMessage: indexPath) ? currentMessage?.senderId() == currentUser.senderID() ? tailessOutgoingBubble : tailessIncomingBubble : currentMessage?.senderId() == currentUser.senderID() ? outgoingBubble : incomingBubble
}
如果您需要更多帮助,请告诉我们