Closed Jinsujin closed 1 year ago
HStack(alignment: .center, spacing: 10) {
Text("Text 1")
.bold()
.cornerRadius(8)
.padding()
.background(.orange)
Text("Text 2")
.bold()
.cornerRadius(8)
.padding()
.background(.orange)
Text("Text 3")
.bold()
.cornerRadius(8)
.padding()
.background(.orange)
Text("Text 4")
.bold()
.cornerRadius(8)
.padding()
.background(.orange)
}
.padding()
.background(.gray)
VStack(alignment: .center, spacing: 10) {
Text("Text 1")
.bold()
.cornerRadius(8)
.padding()
.background(.orange)
Text("Text 2")
.bold()
.cornerRadius(8)
.padding()
.background(.orange)
Text("Text 3")
.bold()
.cornerRadius(8)
.padding()
.background(.orange)
}
.padding()
.frame(width: 300, height: 200, alignment: .leading)
.background(.gray)
ZStack {
Color.indigo
Text("긴 글자")
.foregroundColor(.gray)
Button {
print("touched button!")
} label: {
Text("hit me")
.foregroundColor(.yellow)
.bold()
.font(.system(size: 40, weight: .heavy, design: .rounded))
.padding()
}
.background(.pink)
.cornerRadius(20)
}
문서 바로가기
HStack
VStack
ZStack
알아둘 사항