Skip to content

Commit e8ad0f3

Browse files
author
Mithun
committedJul 11, 2019
Layouts and Stacks
1 parent a567721 commit e8ad0f3

File tree

3 files changed

+73
-11
lines changed

3 files changed

+73
-11
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"info" : {
3+
"version" : 1,
4+
"author" : "xcode"
5+
},
6+
"colors" : [
7+
{
8+
"idiom" : "universal",
9+
"color" : {
10+
"color-space" : "srgb",
11+
"components" : {
12+
"red" : "0.271",
13+
"alpha" : "0.300",
14+
"blue" : "0.788",
15+
"green" : "0.235"
16+
}
17+
}
18+
}
19+
]
20+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"info" : {
3+
"version" : 1,
4+
"author" : "xcode"
5+
},
6+
"colors" : [
7+
{
8+
"idiom" : "universal",
9+
"color" : {
10+
"color-space" : "srgb",
11+
"components" : {
12+
"red" : "0.925",
13+
"alpha" : "0.300",
14+
"blue" : "0.482",
15+
"green" : "0.494"
16+
}
17+
}
18+
}
19+
]
20+
}

‎DesignCode/ContentView.swift

+33-11
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,42 @@ import SwiftUI
1010

1111
struct ContentView: View {
1212
var body: some View {
13-
VStack {
13+
ZStack {
14+
15+
VStack {
16+
Text("Card Back")
17+
}
18+
.frame(width: 300, height: 220.0)
19+
.background(Color.blue)
20+
.cornerRadius(10)
21+
.shadow(radius: 20)
22+
.offset(x: 0, y: -20)
23+
1424
VStack {
15-
Text("UI Design")
16-
.font(.title)
17-
.fontWeight(.bold)
18-
.color(Color("accent"))
19-
.padding(.top)
20-
Text("Certificate")
21-
.color(.white)
25+
HStack {
26+
VStack(alignment: .leading) {
27+
Text("UI Design")
28+
.font(.headline)
29+
.fontWeight(.bold)
30+
.color(Color("accent"))
31+
.padding(.top)
32+
Text("Certificate")
33+
.color(.white)
34+
}
35+
Spacer()
36+
Image("Logo")
37+
.resizable()
38+
.frame(width: 30, height: 30)
39+
}
40+
.padding(.horizontal)
41+
Spacer()
42+
Image("Background")
2243
}
23-
Image("Background")
44+
.frame(width: 340.0, height: 220.0)
45+
.background(Color.black)
46+
.cornerRadius(10)
47+
.shadow(radius: 20)
2448
}
25-
.background(Color.black)
26-
.cornerRadius(10)
2749
}
2850
}
2951

0 commit comments

Comments
 (0)