SwiftUI Base Stack container using VStack HStack
The desired effect
code
import SwiftUI
struct InfoStackView: View {
var body: some View {
HStack {
Image("circle")
.resizable()
.scaledToFit()
.clipShape(Circle())
.overlay(Circle()
.stroke(Color.white, lineWidth: 3))
.shadow(radius: 5)
// .frame(width: 180, height:180, alignment: .center)
VStack(alignment:.leading) {
Text("Sales free Class Map")
.font(.title)
.foregroundColor(.white)
Text("Painted by Hak-hong Sun.")
.font(.subheadline)
.foregroundColor(.white)
HStack{
Image(systemName: "t.square.fill")
.foregroundColor(.pink)
Text(": the Ming dynasty")
.font(.subheadline)
.foregroundColor(Color.white)
.bold()
.italic()
}
}.padding()
}.frame(width: 380, height: 200)
.background(Color.orange)
.cornerRadius(8)
.shadow(radius: 5)
}
}
struct InfoStackView_Previews: PreviewProvider {
static var previews: some View {
InfoStackView()
}
}
Copy the code
More SwiftUI tutorials and code focus columns
- Please pay attention to my column icloudend SwiftUI tutorial and the source www.jianshu.com/c/7b3e3b671…