macOS 11.4

Xcode 12.5.1

1.新建工程,创建一个swiftui文件

 

 

2.创建后有些画布是在下面显示的

 

 

 

 

 

3.先来看下效果图

 

 

4.

CardImageView.swift中

 Image("Shan")

            .resizable()

            .aspectRatio(CGSize(width:1.5, height:1.0),contentMode: .fit)

            .cornerRadius(10)

            .padding(10)

            .shadow(radius:5)

VideoView.swift中

HStack(alignment:.top) {

            Image("Shu")

                .resizable()

                .frame(width:80, height:80)

            VStack(alignment:.leading) {

                Text("How to build an RPG")

                Text("Placeholder")

                    .font(.subheadline)

                    .fontWeight(/*@START_MENU_TOKEN@*/.bold/*@END_MENU_TOKEN@*/)

                    .foregroundColor(Color.green)

                    .multilineTextAlignment(.leading)

            }

            Spacer()

        }

ContentView.swift中

 VStack {

            CardImageView()

            List{

                VideoView()

                VideoView()

                }

            }