From 668e69bd59b80702dc631b859b756feb4127e9e6 Mon Sep 17 00:00:00 2001 From: "art.dambrine" Date: Tue, 6 Apr 2021 10:57:06 +0200 Subject: [PATCH] =?UTF-8?q?ame=CC=81lioration=20navbar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NavigationExemple/ContentView.swift | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/NavigationExemple/ContentView.swift b/NavigationExemple/ContentView.swift index 93ceb5b..bd9c1a5 100644 --- a/NavigationExemple/ContentView.swift +++ b/NavigationExemple/ContentView.swift @@ -10,28 +10,18 @@ import SwiftUI struct ContentView: View { - @State private var score = 0 + @State private var fullScreen = false var body: some View { NavigationView{ - Text("Score: \(score)") - .navigationTitle("Menu principal") - .navigationBarItems( - - trailing: - HStack{ - Button("Add"){ - self.score += 1 - } - - Button("Sub"){ - self.score -= 1 - } - } - - ) + Button("Toogle full screen"){ + self.fullScreen.toggle() + } + .navigationBarTitle("Full Screen") + .navigationBarHidden(fullScreen) } + .statusBar(hidden: fullScreen) } }