Skip to content

Commit 367ec3b

Browse files
evil159github-actions[bot]
authored andcommitted
hide status and tab bars on shake (#10950)
Apparently SwiftUI examples support handy shake-to-hide-nav-bar, this is quite useful for screenshots(e.g. for docs). This expands it to shake-to-fullscreen, that hides nav, tab and status bars. GitOrigin-RevId: 0ca735c426d164186b9faee2d5e94afa547c44c4
1 parent c2af3a3 commit 367ec3b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Sources/Examples/SwiftUI Examples/Testing Examples/SwiftUIRoot.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ struct ExampleView<Content>: View where Content: View {
142142
content
143143
.navigationBarTitleDisplayMode(.inline)
144144
.navigationBarHidden(isNavigationBarHidden)
145+
.toolbar(isNavigationBarHidden ? .hidden : .automatic, for: .tabBar)
146+
.statusBarHidden(isNavigationBarHidden)
145147
.onShake {
146148
isNavigationBarHidden.toggle()
147149
}

0 commit comments

Comments
 (0)