Created
September 25, 2022 04:10
-
-
Save ra9r/7359ff64e6dd9c2e8f7bada31f1bbdc2 to your computer and use it in GitHub Desktop.
Styling SwiftUI List backgrounds
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List { | |
} | |
.onAppear { | |
// If you set the underlying UITableView appearance to "clear" | |
// it will allow the view's background colors to show through. | |
UITableView.appearance().backgroundColor = UIColor.clear | |
UITableViewCell.appearance().backgroundColor = UIColor.clear | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is the old way to do things. On iOS 16 and up it no longer works and the new/better way is in this gist.