Skip to content

Commit

Permalink
scrollContentBackground sample
Browse files Browse the repository at this point in the history
  • Loading branch information
TahaTesser committed Sep 26, 2024
1 parent 3645ff8 commit 5d18642
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 0 deletions.
Binary file not shown.
21 changes: 21 additions & 0 deletions SwiftUIPlayground/Assets.xcassets/sequoia.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "sequoia.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions SwiftUIPlayground/Samples.swift
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ public let samples: [String: AnyView] = [
"Form": AnyView(FormSample()),
// https://developer.apple.com/documentation/swiftui/groupbox
"GroupBox": AnyView(GroupBoxSample()),
// https://developer.apple.com/documentation/swiftui/view/scrollcontentbackground(_:)
"scrollContentBackground": AnyView(ScrollContentBackgroundSample()),
]
)),
"Lists": AnyView(SamplesList(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//
// ScrollContentBackgroundSample.swift
// SwiftUIPlayground
//
// Created by Taha Tesser on 27.09.2024.
//

import SwiftUI

struct ScrollContentBackgroundSample: View {
var body: some View {
List {
Text("One")
Text("Two")
Text("Three")
}
.background(Image(.sequoia))
.scrollContentBackground(.hidden)
}
}

#Preview {
ScrollContentBackgroundSample()
}

0 comments on commit 5d18642

Please sign in to comment.