Skip to content

Document how to change the padding inside a text message bubble - #1931

Open
martinpucik wants to merge 1 commit into
MessageKit:mainfrom
martinpucik:claude/dreamy-keller-dsvow5
Open

martinpucik wants to merge 1 commit into
MessageKit:mainfrom
martinpucik:claude/dreamy-keller-dsvow5

Conversation

@martinpucik

Copy link
Copy Markdown
Contributor

What does this implement/fix? Explain your changes.

Adds a FAQ entry on changing the space between the text and the edge of a text message bubble.

  • The padding comes from incomingMessageLabelInsets and outgoingMessageLabelInsets on TextMessageSizeCalculator. The calculator adds them to the text size and passes them to TextMessageCell through messageLabelInsets.
  • MessagesCollectionViewFlowLayout has separate calculators for .text, .attributedText and .emoji, so the example sets the insets on all three.
  • The entry explains how this differs from setMessageIncoming/OutgoingMessagePadding(_:), which sets the space outside the bubble.
  • It shows how to use different insets for some messages only, by returning a stored calculator from textCellSizeCalculator(for:at:in:). It also says why creating a calculator on every call and changing the layout's itemSize (what the issue tried) has no effect: cells are sized by the calculator through sizeForItem(at:), not by itemSize.

It also adds the missing contents link for the existing "Why is didTapMessage(in:) not called when I tap a photo or video message?" entry, and a CHANGELOG line.

Does this close any currently open issues?

Answers #1811.

Any relevant logs, error output, etc?

None.

Any other comments?

This changes documentation only. I checked the default inset values, the calculator properties and the delegate signatures against Sources/Layout/TextMessageSizeCalculator.swift, MessagesCollectionViewFlowLayout.swift and MessagesLayoutDelegate.swift.

Where has this been tested?

Devices/Simulators: N/A (documentation only)

iOS Version: N/A

Swift Version: N/A

MessageKit Version: main


Generated by Claude Code

This branch has not been deployed

No deployments
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.

2 participants