-
Notifications
You must be signed in to change notification settings - Fork 0
/
HeaderView.swift
35 lines (32 loc) · 1.02 KB
/
HeaderView.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import SwiftUI
struct HeaderView: View {
let title: String
let subtitle: String
let angle: Double
let background: Color
var body: some View {
ZStack {
RoundedReactangle(cornerRadius: 0)
.foregroundColor(background)
.rotationEffect(Angle(degrees: angle))
Vstack {
Text(title)
.font(.system(size: 70))
.foregroundColor(Color.white)
.bold()
Text(subtitle)
.font(.system(size: 40))
.foregroundColor(Color.white)
}
.padding(.top, 80)
}
.frame(width: UIScreen.main.bounds.width * 3,
height: 350)
.offset(y: -150)
}
}
struct HeaderView_Previews: PreviewProvider {
static var previews: some View {
HeaderView(title: "Title", subtitle: "subtitle", angle: 15, background: .blue)
}
}