//// ContentView.swift// HelloSwiftUI//// Created by jeff on 2024/04/06.//import SwiftUIstruct ContentView: View { @State var str = "Hello, SwiftUI" var body: some View { VStack { Rectangle() .foregroundColor(.orange) .frame(width:200, height: 50) Rectangle() .foregroundColor(.red) .frame(width:180, height: 20) Rectangle() .foregroundColor(.yellow) .frame(width:180, height: 20) Rectangle() .foregroundColor(.brown) .frame(width:180, height: 20) Rectangle() .foregroundColor(.green) .frame(width:180, height: 20) Rectangle() .foregroundColor(.orange) .frame(width:200, height: 50) } ZStack { Rectangle() .foregroundColor(.green) .frame(width:300, height: 300) VStack { HStack{ Rectangle() .foregroundColor(.black) .frame(width:70, height: 70) Rectangle() .foregroundColor(.black) .frame(width:70, height: 70) } Rectangle() .foregroundColor(.black) .frame(width:50, height: 20) Rectangle() .foregroundColor(.black) .frame(width:100, height: 80) } } .padding() }}#Preview { ContentView()}

SwiftUIアプリ開発講座 by RikutoSato
0 件のコメント:
コメントを投稿