iPhoneアプリ開発勉強SwiftUI (問題①、問題②)


//
//  ContentView.swift
//  HelloSwiftUI
//
//  Created by jeff on 2024/04/06.
//

import SwiftUI

struct 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

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です