update
This commit is contained in:
34
demo/Views/Layouts/NavigationPageView.swift
Normal file
34
demo/Views/Layouts/NavigationPageView.swift
Normal file
@@ -0,0 +1,34 @@
|
||||
//
|
||||
// NavigationPageView.swift
|
||||
// demo
|
||||
//
|
||||
// Created by Jason on 2024/1/25.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct NavigationPageView: View {
|
||||
@Environment(\.dismiss) private var dismiss
|
||||
var title: String = ""
|
||||
var content: any View
|
||||
|
||||
var body: some View {
|
||||
ScrollView {
|
||||
AnyView(content)
|
||||
}
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.navigationTitle(title)
|
||||
.navigationBarBackButtonHidden(true)
|
||||
.toolbar {
|
||||
ToolbarItem(placement: .navigationBarLeading) {
|
||||
Button {
|
||||
dismiss()
|
||||
} label: {
|
||||
HStack {
|
||||
Image(systemName: "chevron.backward")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user