Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions Sources/Showcase/ListPlayground.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ enum ListPlaygroundType: String, CaseIterable {
case plainStyleSectionedEditActions
case onMoveDelete
case positioned
case topContent

var title: String {
switch self {
Expand Down Expand Up @@ -62,6 +63,8 @@ enum ListPlaygroundType: String, CaseIterable {
return ".onMove, .onDelete"
case .positioned:
return "Positioned"
case .topContent:
return "Top content"
}
}
}
Expand Down Expand Up @@ -135,6 +138,10 @@ struct ListPlayground: View {
case .positioned:
PositionedListPlayground()
.navigationTitle($0.title)
case .topContent:
ListWithTopContentPlayground()
.navigationTitle($0.title)

}
}
}
Expand Down Expand Up @@ -693,3 +700,28 @@ struct PositionedListPlayground: View {
}
}
}

struct ListWithTopContentPlayground: View {
var body: some View {
List {
HStack(spacing: 0) {

VStack {
Text("left text")
.frame(maxWidth: .infinity)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It also happens if you do an HStack with two Spacer() instead of .frame(maxWidth: .infinity)

}

VStack {
Text("right text")
.frame(maxWidth: .infinity)
}
}

Section {
ForEach(0..<30, id: \.self) { index in
Text("Row \(index)")
}
}
}
}
}
8 changes: 8 additions & 0 deletions Sources/Showcase/Resources/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -1692,6 +1692,10 @@
},
"LazyVStack.%@" : {

},
"left text" : {
"comment" : "A label displayed on the left side of a horizontal stack view in the playground.",
"isCommentAutoGenerated" : true
},
"Light" : {

Expand Down Expand Up @@ -2215,6 +2219,10 @@
},
"RGB" : {

},
"right text" : {
"comment" : "A label displayed below a vertical stack view.",
"isCommentAutoGenerated" : true
},
"Rotate" : {

Expand Down
Loading