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

41 lines
865 B
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: String
/// View
@ViewBuilder let contentView: Content
var body: some View {
NavigationView {
ZStack {
Spacer()
.frame(width: .infinity, height: .infinity)
contentView
}
.background(
Image("deer.gray").offset(x: -150, y: -10),
alignment: .bottom
)
.navigationBarTitle(title)
}
.navigationViewStyle(.stack)
}
}
struct BaseNavigationView_Previews: PreviewProvider {
static var previews: some View {
BaseNavigationView(title: "标题") {
Text("内容")
}
}
}