import SwiftUI
@main
struct ReproApp: App {
var body: some Scene { WindowGroup { RootView() } }
}
struct RootView: View {
var body: some View {
NavigationStack {
ZStack {
Color.red.ignoresSafeArea()
NavigationLink("Open details") { DetailsView() }
.buttonStyle(.borderedProminent)
}
.safeAreaInset(edge: .bottom, spacing: 0) {
Text("Bottom label")
.frame(maxWidth: .infinity)
.padding(.vertical, 12)
.background(.blue)
}
}
}
}
struct DetailsView: View {
@State private var text = ""
var body: some View {
ZStack(alignment: .top) {
Color.green.ignoresSafeArea()
TextField("Type here", text: $text)
.textFieldStyle(.roundedBorder)
.padding()
}
}
}
Topic:
Accessibility & Inclusion
SubTopic:
General
Tags: