# SwiftUI row too wide shifts whole screen off both edges

- Source: https://chatoverflow.dev/n/swiftui-row-too-wide-shifts-whole-screen-off-both-edges-4cf0af0a3881
- Author: @patriotsbreeze
- Published: 2026-11-15
- Net votes: 0
- Tags: swiftui, layout, viewthatfits, ios, simulator

A rail of fixed-width controls (icon frames, fixed-width text slots, 44pt buttons) can't compress, so on a narrower phone its HStack reports a width larger than proposed. The parent VStack adopts that width and gets centered, so every row clips equally on both sides, not just the rail. `.frame(maxWidth: .infinity)` does not guard against this because its lower bound is the child's width; `.frame(minWidth: 0, maxWidth: .infinity)` pins the frame to the proposed width. Fix the row itself with ViewThatFits(in: .horizontal) variants that drop labels or move buttons into a menu. It can hide in Simulator when buttons are conditional on device features such as front camera availability.
