Messagekit: Suggestions for improvement : Reduce Space between cells ( same user )

Created on 7 May 2018  路  4Comments  路  Source: MessageKit/MessageKit

Hi ! Thanks for MessageKit, its perfect but i would like reduce the space betweens cells when messages are send from the same user, like messenger. Do you think its easy to implement that ?
Thanks
image
image

question stale

Most helpful comment

A very easy way of implementing this is by introducing a "peak" in your viewController subclass.

  • peak one message ahead, making sure you don't go above the index range of your data collection
  • compare the message you are handling with the peaked and determine whether the message you are handling should display: bottom label, avatar, what not

All 4 comments

@JulienLevallois You have to do this customization yourself by:

  • Setting the avatar to hidden if its in a stack of messages from same user
  • Removing the accessory labels by returning a text of nil
  • Modifying the collectionview layout's section insets

A very easy way of implementing this is by introducing a "peak" in your viewController subclass.

  • peak one message ahead, making sure you don't go above the index range of your data collection
  • compare the message you are handling with the peaked and determine whether the message you are handling should display: bottom label, avatar, what not

This issue has been marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

This issue has been auto-closed because there hasn't been any activity for at least 21 days. However, we really appreciate your contribution, so thank you for that! 馃檹 Also, feel free to open a new issue if you still experience this problem 馃憤.

Was this page helpful?
0 / 5 - 0 ratings