2

I am trying to use JSQMessagesViewController and I want to remove the tail from the speech bubbles so they are displayed as regular rounded rectangles. I have this code for the initial setup:

let imageFactory = JSQMessagesBubbleImageFactory(bubbleImage: UIImage.jsq_bubbleRegularTaillessImage(), capInsets: UIEdgeInsetsZero)
incomingBubbleImageData = imageFactory.incomingMessagesBubbleImageWithColor(incomingColor)
outgoingBubbleImageData = imageFactory.outgoingMessagesBubbleImageWithColor(outgoingColor)

and then:

override func collectionView(collectionView: JSQMessagesCollectionView!, messageBubbleImageDataForItemAtIndexPath indexPath: NSIndexPath!) -> JSQMessageBubbleImageDataSource! {
        let messagesArray = messagesArrayForSection(indexPath.section)
        let message = messagesArray[indexPath.row]
        if message.senderId == senderId {
            return outgoingBubbleImageData
        }

        return incomingBubbleImageData
    }

This is working and cutting off the tail for speech bubbles with text, but for images the tail is still there:

enter image description here

Any ideas what I might be doing wrong here? Any pointers would be really appreciated. thanks!

Kex
  • 8,023
  • 9
  • 56
  • 129

2 Answers2

0

https://github.com/jessesquires/JSQMessagesViewController/issues/1168#issuecomment-167153451

In JSQMessageBubbleImageFactory.m change this line:

        -(instancetype)init
        {
         return [self initWithBubbleImage:[UIImage 
               jsq_bubbleRegularTaillessImage] 
               capInsets:UIEdgeInsetsZero];
        }
Maulik Patel
  • 2,045
  • 17
  • 24
-1

Take a look at this thread:

https://github.com/jessesquires/JSQMessagesViewController/issues/1168#issuecomment-167153451

In JSQMessageBubbleImageFactory.m change this line:

- (instancetype)init
{
//    return [self initWithBubbleImage:[UIImage jsq_bubbleCompactImage] capInsets:UIEdgeInsetsZero];
    return [self initWithBubbleImage:[UIImage jsq_bubbleCompactTaillessImage] capInsets:UIEdgeInsetsZero];
}
MJQZ1347
  • 2,607
  • 7
  • 27
  • 49
  • - (instancetype)init { return [self initWithBubbleImage:[UIImage jsq_bubbleRegularTaillessImage] capInsets:UIEdgeInsetsZero]; } – Maulik Patel Oct 04 '17 at 07:19