使用堆栈合并视图

2020-12-24  本文已影响0人  瓦大西精神小伙丶澎

ContentView

import SwiftUI

struct ContentView: View {
    var body: some View {
        VStack(alignment:.leading) {
            Text("Turtle Rock")
                .font(.title)
                .foregroundColor(.green)

            HStack {
                Text("Joshua Tree National Park")
                    .font(.subheadline)
                Spacer()
                Text("California")
                    .font(.subheadline)
            }
        }
        .padding()
    }
}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        Group {
            ContentView()
        }
    }
}

image.png
上一篇下一篇

猜你喜欢

热点阅读