SwiftUI(一)
2024-09-07 11:56:32
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()
}
}
最新文章
- UI进阶 跳转系统设置相关界面的方法
- 自顶而下设计FPGA
- openoffice
- 记录maven java.lang.String cannot be cast to XX error
- DIV相关的操作总结
- cmd+lcx+nc+sc提权工具总结
- Octopus系列之SQLite3常用命令
- Spring MVC mapping[From Spring MVC Beginner's Guide]
- PowerDesigner(三)-企业架构模型(转)
- Redis使用(1)---安装
- 学习rollup.js模块文件打包
- UOJ14 UER #1 DZY Loves Graph(最小生成树+并查集)
- Python 回溯算法
- 337A
- VBO最佳实践
- BZOJ4559: [JLoi2016]成绩比较(dp 拉格朗日插值)
- PM2来部署nodejs服务器永久开启
- orcal数据库基本操作
- es6(10)--Set,Map(2)
- [poj 1947] Rebuilding Roads 树形DP
热门文章
- CentOS7虚拟机配置git仓库(配置虚拟机,网络,git仓库,windows端git访问)
- 题解 P6355 [COCI2007-2008#3] DEJAVU
- 基于FPGA的SATA3.0主机控制器IP
- ubuntu 输入法IBUS 输入不成功问题
- LAPM概述及配置
- xmind下载安装破解版激活教程思维导图软件获取
- [ PHP 内核与扩展开发系列] 内存管理 —— 引用计数
- 关于C++ find
- <;四>;理解空间配置器allocator, 优化STL 中的Vector
- Python基础之数据库:5、创建表的完整语法、MySQL数据类型