Layout shift HStack with four maxWidth: .infinity buttons
Open
@aabewhite is already working on this.
Since Jan 9, 2026.
layout
performance
- Dominant language
- Swift
- Stars
- 330
- Forks
- 76
- Avg merge
- 3h 6m
- Merged PRs (30d)
- 1
Description
To repro: skip create an open-source Skip Lite app. Run it in the Android Emulator on a Medium Phone API 36. Replace ContentView.swift with this:
// SPDX-License-Identifier: GPL-2.0-or-later
import SwiftUI
struct GrowableButton: View {
var body: some View {
Button {} label: {
Text("Hi")
.frame(maxWidth: .infinity)
}
.buttonStyle(.borderedProminent)
}
}
struct ContentView: View {
var body: some View {
HStack {
GrowableButton()
GrowableButton()
GrowableButton()
GrowableButton()
}
}
}
This works just great on iOS, but in Android, there's a layout shift, as it initially shows only the first button at ~0.75 width of the screen, and then renders all four buttons. Screen recording below.
https://github.com/user-attachments/assets/c3ff5bdc-e170-4a09-bb35-242b465638da
At 0.25 speed:
https://github.com/user-attachments/assets/a5998bc5-b925-4314-98be-ddd77aff25cf
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.
Assessment
This issue has not been assessed yet.