StackView
struct ContentView: View {
var body: some View {
GeometryReader { geometry in
VStack {
HStack {
VStack {
Text("Hello, World!")
.padding(5)
.background(Color.blue)
.font(.headline)
Text("I'm Tom!")
.padding(5)
.background(Color.green)
.font(.subheadline)
.rotationEffect(Angle(degrees: -19))
Text("This is my First SwiftUI Project")
.padding(5)
.background(Color.yellow)
.font(.subheadline)
.rotationEffect(Angle(degrees: 14))
}
Image("1")
.resizable()
.aspectRatio(contentMode: .fill)
.frame(width: geometry.size.width / 3, height: geometry.size.height / 3)
.clipped()
}
Text("Which you need?")
.fontWeight(.bold)
.padding()
.foregroundColor(Color.red)
Picker(selection: .constant(1), label: Text("")) {
Text("Yesterday").tag(1)
Text("Today").tag(2)
Text("Tomorrow").tag(3)
}
.frame(width: -4.0, height: -1.0)
}
}
}
}
}
コメント
コメントを投稿