Skip to content

Instantly share code, notes, and snippets.

@TuenTuenna
Last active September 3, 2021 07:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TuenTuenna/6c68cb3c25ac70224bbadc0a97ffdbd4 to your computer and use it in GitHub Desktop.
Save TuenTuenna/6c68cb3c25ac70224bbadc0a97ffdbd4 to your computer and use it in GitHub Desktop.
SwiftUI 네비게이션 뷰 네브 바 위치 설정

SwiftUi 네비게이션 바 위치 설정

//
//  ContentView.swift
//  MatchedGeometry_tutorial_test
//
//  Created by Jeff Jeong on 2021/04/02.
//

import SwiftUI

struct ContentView : View {
    var body: some View {
        NavigationView {
            // ZStack 으로 중첩처리
            ZStack {
                // 뒷 배경부분
                Color
                    .yellow
                    .edgesIgnoringSafeArea(.all)
                    .navigationTitle("오늘도 빡코딩 🔥👨‍💻")
                    .toolbar {
                        ToolbarItemGroup(placement: .navigationBarTrailing) {
                            Button("About") {
                                print("About tapped!")
                            }
                            Button("Help") {
                                print("Help tapped!")
                            }
                        }
                    }
                // 실질적인 화면 컨텐트
                VStack{
                    Text("하하하")
                }
            }
        }
    }
}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment