Skip to content

Document how to change the alignment of the message labels - #1930

Merged
martinpucik merged 1 commit into
MessageKit:mainfrom
martinpucik:claude/dreamy-keller-jrtpfo
Nov 8, 2026
Merged

martinpucik merged 1 commit into
MessageKit:mainfrom
martinpucik:claude/dreamy-keller-jrtpfo

Conversation

@martinpucik

Copy link
Copy Markdown
Contributor

What does this implement/fix? Explain your changes.

Adds a FAQ entry, "How can I change the alignment of the message top and bottom labels?", which covers:

  • that messageTopLabel and messageBottomLabel span the whole cell width, so their position comes from the NSTextAlignment and textInsets of a LabelAlignment, and what the defaults are
  • setting the alignment for all incoming or outgoing messages with the MessagesCollectionViewFlowLayout setters
  • setting it per message with messageTopLabelAlignment(for:at:in:) / messageBottomLabelAlignment(for:at:in:) of MessagesLayoutDelegate, with an example that puts the bottom label of incoming messages under the right edge of the bubble. The insets are computed from the size calculator's avatar size, avatar padding, container padding and container size, using the same values layoutMessageContainerView(with:) uses.

It also adds the entry to the FAQ index and a CHANGELOG line.

Does this close any currently open issues?

Addresses #826 (align the message bottom label to the right side of the bubble for incoming messages).

Any relevant logs, error output, etc?

None.

Any other comments?

This only changes documentation. The example's inset math assumes the avatar keeps its default .cellLeading horizontal position for incoming messages, and the entry says so.

Where has this been tested?

Devices/Simulators: Not run. This change is documentation only, and I checked the APIs it uses against the sources.

iOS Version: N/A

Swift Version: N/A

MessageKit Version: main


Generated by Claude Code

Add a FAQ entry that explains the message top and bottom labels span
the cell, how to set their alignment for all messages through the
MessagesCollectionViewFlowLayout setters, and how to set it per message
through MessagesLayoutDelegate, with an example that lines the bottom
label of incoming messages up with the right edge of the bubble (MessageKit#826).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kdtqz7yH52gZhqUYxRH3sH
@martinpucik
martinpucik merged commit 3e8521c into MessageKit:main Nov 8, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants