SwiftUI(一)
阅读原文时间:2023年07月10日阅读:1

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()

}

}

手机扫一扫

移动阅读更方便

阿里云服务器
腾讯云服务器
七牛云服务器

你可能感兴趣的文章