`.frame(maxWidth:)` ignores parent bounds
Open
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 330
- Forks
- 76
- Avg merge
- 3h 6m
- Merged PRs (30d)
- 1
Description
VStack(spacing: 16) {
Text("Divider (fills available width with padding)")
Color.gray.frame(height: 1)
Text("HStack with .frame(maxWidth: 400)")
HStack {
Text("Label")
.foregroundColor(.secondary)
Spacer()
Text("Value")
}
.frame(maxWidth: 400)
.border(.red)
}
.padding()
On iOS, the HStack aligns horizontally with the divider. On Android, the .frame(maxWidth: 400) forces the HStack to ignore the parent bounds.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the provided VStack and HStack reproduction on Android, then compare its layout with the iOS result. Done means .frame(maxWidth: 400) respects the parent bounds so the HStack aligns with the divider as shown.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, swift
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100