Messagekit: Align message bottom label to the right side of the bubble (incoming message)

Created on 23 Aug 2018  路  5Comments  路  Source: MessageKit/MessageKit

Just an idea for future enhancements, to align message bottom label to the right side of the bubble (incoming messages).

example_align_right

Of course, it is possible to use custom cell (put message text and time text together), but would be nice to align message bottom label (and message top label) accordingly to the width of the bubble.

feature request

Most helpful comment

@maxxx777 That's a fair point. I'll look into this a bit more 馃憤

All 5 comments

This should already be possible by changing the label alignment properties on a cell's respective MessageSizeCalculator object

yes, it is possible for top label if we change incomingCellTopLabelAlignment,
but there is no option for bottom label like incomingCellBottomLabelAlignment.
If we change incomingMessageBottomLabelAlignment to .right, it aligns the label to the right side of the collection view (not the right side of the bubble):

example_align_right_2

Should I create a new issue to add incomingCellBottomLabelAlignment and outgoingCellBottomLabelAlignment to MessageSizeCalculator?

@maxxx777 IIRC, the reason why this isn't possible is for performance reasons. The size of the cell labels surrounding the MessageLabel are static. When you change the incomingCellBottomLabel alignment what you are really doing is changing the NSTextAlignment for that label. You can achieve the effect you want by setting the insets for that label as well.

However, I don't think this will have support in MessageKit beyond what is capable already

You can achieve the effect you want by setting the insets for that label as well.

yes, but there should be different insets for each cell, because of different width of bubbles.

@SD10 thanks for your time. I guess I can close the issue.

@maxxx777 That's a fair point. I'll look into this a bit more 馃憤

Was this page helpful?
0 / 5 - 0 ratings

Related issues

TheDarkCode picture TheDarkCode  路  3Comments

JulienLevallois picture JulienLevallois  路  4Comments

pawankmrai picture pawankmrai  路  3Comments

adri4silva picture adri4silva  路  4Comments

robertoferraz picture robertoferraz  路  3Comments