Couleur d'arrière-plan Swiftui
Group {
//Views inside the highest view in the hierarchy
}.background(Color.red.edgesIgnoringSafeArea(.all))
EDestroyer
Group {
//Views inside the highest view in the hierarchy
}.background(Color.red.edgesIgnoringSafeArea(.all))
extension UIStackView {
func addBackground(color: UIColor) {
let subView = UIView(frame: bounds)
subView.backgroundColor = color
subView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
insertSubview(subView, at: 0)
}
}
struct ContentView: View {
var body: some View {
ZStack {
Color.red
.edgesIgnoringSafeArea(.all)
}
}
}