pushdeer/ios/PushDeer-iOS/PushDeer/View/Common/BaseNavigationView.swift

51 lines
1.1 KiB
Swift
Raw Normal View History

2021-12-27 22:33:27 +08:00
//
// BaseNavigationView.swift
// PushDeer
//
// Created by HEXT on 2021/12/26.
//
import SwiftUI
/// View, APP使
struct BaseNavigationView<Content : View> : View {
///
let title: LocalizedStringKey
2021-12-27 22:33:27 +08:00
/// View
@ViewBuilder let contentView: Content
@Environment(\.colorScheme) private var colorScheme
2021-12-27 22:33:27 +08:00
var body: some View {
NavigationView {
ZStack {
// VStack HStack Spacer
VStack {
HStack {
Spacer()
}
Spacer()
}
2021-12-27 22:33:27 +08:00
contentView
}
.background(
Image("deer.gray")
.offset(x: -150, y: -10)
.opacity(colorScheme == .dark ? 0.4 : 1),
2021-12-27 22:33:27 +08:00
alignment: .bottom
)
.navigationBarTitle(title)
}
.navigationViewStyle(.stack)
}
}
struct BaseNavigationView_Previews: PreviewProvider {
static var previews: some View {
BaseNavigationView(title: "标题") {
Text("内容")
}
.environment(\.colorScheme, .dark)
2021-12-27 22:33:27 +08:00
}
}