Messagekit: Setting spacing between message cells

Created on 6 Feb 2018  路  1Comment  路  Source: MessageKit/MessageKit

Is the best way to set the spacing between the message cells changing the padding values in MessagesLayoutDelegate?
In order to get the messages closer together after removing the top and bottom labels, I did the following:

    if isFromCurrentSender(message: message) {
        return UIEdgeInsets(top: -15, left: 30, bottom: 5, right: 4)
    } else {
        return UIEdgeInsets(top: -15, left: 4, bottom: 5, right: 30)
    }

but was wondering if there was a way to just remove the top and bottom labels entirely so I do not have to adjust for the empty space with negative padding?

Thanks!

question

Most helpful comment

There should be no negative space as the labels are sized to fit. If they have no text there will be no frame. If you're talking about cell spacing you should check https://developer.apple.com/documentation/uikit/uicollectionviewflowlayout/1617714-sectioninset

>All comments

There should be no negative space as the labels are sized to fit. If they have no text there will be no frame. If you're talking about cell spacing you should check https://developer.apple.com/documentation/uikit/uicollectionviewflowlayout/1617714-sectioninset

Was this page helpful?
0 / 5 - 0 ratings