49 lines
1.0 KiB
Swift
49 lines
1.0 KiB
Swift
//
|
|
// ClearBackgroundList.swift
|
|
// Profile
|
|
//
|
|
// Created by Javier Cicchelli on 03/12/2022.
|
|
// Copyright © 2022 Röck+Cöde. All rights reserved.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct ClearBackgroundList<Content>: View where Content: View {
|
|
|
|
// MARK: Properties
|
|
|
|
@ViewBuilder let content: Content
|
|
|
|
// MARK: Body
|
|
|
|
var body: some View {
|
|
if #available(iOS 16.0, *) {
|
|
List{
|
|
content
|
|
}
|
|
.scrollContentBackground(.hidden)
|
|
.scrollIndicators(.hidden)
|
|
} else {
|
|
List {
|
|
content
|
|
}
|
|
.onAppear {
|
|
UITableView.appearance().backgroundColor = .clear
|
|
UITableView.appearance().showsVerticalScrollIndicator = false
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
// MARK: - Previews
|
|
|
|
struct ClearBackgroundList_Previews: PreviewProvider {
|
|
static var previews: some View {
|
|
ClearBackgroundList {
|
|
Text("Something...")
|
|
}
|
|
.background(Color.red)
|
|
}
|
|
}
|