Spacer inside ScrollView breaks layout #27

Open
opened 2025-10-14 15:43:38 -06:00 by navan · 0 comments
Owner

Originally created by @Amzd on 1/19/2024

Putting a horizontal Spacer inside a ScrollView breaks layout.

ScrollView {
  VStack {
    HStack {
      Button("test ") {}
      Spacer() // this spacer inside scrollview is bad!
      Text("text i want to align right")
    }
  }.border(.blue)
}.border()

image

Am I doing something wrong or is this expected? Really cool project otherwise!

*Originally created by @Amzd on 1/19/2024* Putting a horizontal `Spacer` inside a `ScrollView` breaks layout. ```swift ScrollView { VStack { HStack { Button("test ") {} Spacer() // this spacer inside scrollview is bad! Text("text i want to align right") } }.border(.blue) }.border() ``` ![image](https://github.com/rensbreur/SwiftTUI/assets/17001151/972a8c71-2850-4f9b-81d2-1009b535bc80) Am I doing something wrong or is this expected? Really cool project otherwise!
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github/SwiftTUI#27
No description provided.