Skip to content

Commit 5d18642

Browse files
committed
scrollContentBackground sample
1 parent 3645ff8 commit 5d18642

File tree

5 files changed

+47
-0
lines changed

5 files changed

+47
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "sequoia.png",
5+
"idiom" : "universal",
6+
"scale" : "1x"
7+
},
8+
{
9+
"idiom" : "universal",
10+
"scale" : "2x"
11+
},
12+
{
13+
"idiom" : "universal",
14+
"scale" : "3x"
15+
}
16+
],
17+
"info" : {
18+
"author" : "xcode",
19+
"version" : 1
20+
}
21+
}
Loading

SwiftUIPlayground/Samples.swift

+2
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ public let samples: [String: AnyView] = [
9595
"Form": AnyView(FormSample()),
9696
// https://developer.apple.com/documentation/swiftui/groupbox
9797
"GroupBox": AnyView(GroupBoxSample()),
98+
// https://developer.apple.com/documentation/swiftui/view/scrollcontentbackground(_:)
99+
"scrollContentBackground": AnyView(ScrollContentBackgroundSample()),
98100
]
99101
)),
100102
"Lists": AnyView(SamplesList(
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
//
2+
// ScrollContentBackgroundSample.swift
3+
// SwiftUIPlayground
4+
//
5+
// Created by Taha Tesser on 27.09.2024.
6+
//
7+
8+
import SwiftUI
9+
10+
struct ScrollContentBackgroundSample: View {
11+
var body: some View {
12+
List {
13+
Text("One")
14+
Text("Two")
15+
Text("Three")
16+
}
17+
.background(Image(.sequoia))
18+
.scrollContentBackground(.hidden)
19+
}
20+
}
21+
22+
#Preview {
23+
ScrollContentBackgroundSample()
24+
}

0 commit comments

Comments
 (0)