Created
September 16, 2025 09:44
-
-
Save larsaugustin/83837ab1ac7105a6c43c1346fad45e69 to your computer and use it in GitHub Desktop.
FauxToolbar SwiftUI
This file contains hidden or 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
@main | |
struct FauxToolbarApp: App { | |
var body: some Scene { | |
WindowGroup { | |
ContentView() | |
.toolbarTitleDisplayMode(.inline) | |
.toolbarBackgroundVisibility(.hidden, for: .windowToolbar) | |
} | |
.windowToolbarLabelStyle(fixed: .iconOnly) | |
.windowToolbarStyle(.unified) | |
} | |
} | |
struct ContentView: View { | |
var body: some View { | |
VStack { | |
TextField("", text: .constant("Right Click Me")) | |
.frame(width: 300) | |
.padding(.top) | |
Spacer() | |
} | |
.ignoresSafeArea() | |
.toolbarBackgroundVisibility(.hidden, for: .windowToolbar) | |
.toolbar { | |
Spacer() | |
}.navigationTitle(Text("")) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment