//
|
// TitleBarView.swift
|
// aones
|
//
|
// Created by 倪路朋 on 2/16/23.
|
//
|
|
import SwiftUI
|
|
struct TitleBarView: View {
|
|
@Environment(\.presentationMode) var presentationMode
|
|
var title = ""
|
var iconBack = IconBack();
|
var imgRight = "";
|
var titleColor = Color.colorText
|
|
var body: some View {
|
|
HStack(spacing: 0){
|
Spacer().frame(width: 16)
|
Button(action: {
|
print("Click back button")
|
self.presentationMode.wrappedValue.dismiss()
|
}) {
|
iconBack.stroke(Color.primary, lineWidth: 2.5).frame(width: 18,height: 14)
|
}
|
Spacer()
|
Text(title).foregroundColor(titleColor)
|
.bold().font(Font.system(size: 16))
|
Spacer()
|
Image(imgRight).frame(width: 28,height: 28)
|
Spacer().frame(width: 16)
|
}.frame(height: 48)
|
}
|
}
|
|
struct TitleBarView_Previews: PreviewProvider {
|
static var previews: some View {
|
TitleBarView(title: "标题")
|
}
|
}
|