当前位置:网站首页>SwiftUI 4 新功能 之 网格视图Gridview组件 (教程含源码)
SwiftUI 4 新功能 之 网格视图Gridview组件 (教程含源码)
2022-06-25 21:32:00 【知识大胖】
SwiftUI 4 引入了一个名为Gridview 的新容器视图。AGrid是一个容器视图,它通过将其子视图排列成行和列来为我们提供二维布局。
Grid我们通过使用集合初始化来创建布局GridRows。让我们创建一个示例以更好地理解:
struct ContentView: View {
var body: some View {
VStack {
Grid {
GridRow {
Label("OpenSwiftUI", systemImage: "heart")
Label("iOS Development", systemImage: "graduationcap")
}
}
.font(.title3)
}
.padding()
}
}
我们可以像这样添加更多的网格行:
struct ContentView: View {
var body: some View {
VStack {
Grid {
GridRow {
Label("OpenSwiftUI", systemImage: "heart")
Label("iOS Development", systemImage: "graduationcap")
}
GridRow {
Label("SwiftUI" , systemI
边栏推荐
- OBD Position Overview
- Differences between modems and routers (powercert animated videos)
- “No bean named ‘UserController‘ available“
- Input a line of characters to count the English letters, spaces, numbers and other characters
- 1.1-mq visual client preliminary practice
- Jmeter- (I) installation of interface test
- 同花顺炒股软件开户是合法的吗?安全吗
- 熊市指南|一些本质的教训与具体的生存法则
- Analysis and cleaning of kdevtmpfsi virus content
- [important notice] developer document update (12.13-12.19)
猜你喜欢
[nailing scenario capability package] smart office phone
[nailing scenario capability package] video conference (official conference system)
Free your hands and automatically brush Tiktok
What is a server? (Powercert animated videos)
Website judges network connection disconnection, JS judges network connection disconnection, best practice
On merging and sorting
数学分析_笔记_第4章:连续函数类和其他函数类
js禁用浏览器 pdf 打印、下载功能(pdf.js 禁用打印下载、功能)
XMIND to excel test case
C language soul torture: do you know the difference between the two?
随机推荐
CANoe. Diva operation guide TP layer test
ECU test modify test case
Type conversion basis
[nailing scenario capability package] manage the on-the-job / off-the-job situation of employees
Multi database and multi table backup and restore of MySQL under Linux
Is Galaxy Securities reliable? Is it safe to open a securities account?
Openocd adds third-party device support: ht32f52352 Cortex-M0+
Common singleton functions traverse dictionary functions
MySQL operation Basics
[summary] 2021unctf Campus (cry & MISC)
Desktop network error display red ×, Component failed to start
What is DNS (domain name server)? (Powercert animated videos)
[nailing scenario capability package] exhibition admission
Mutual conversion of CString and char*
Kubernetes related knowledge - surprise interview
Invalid bound statement (not found): com. qf. mapper. PassengerMapper. findByPassengerId
同花顺炒股软件开户是合法的吗?安全吗
Getting started and using postman
PHP runtime and memory consumption statistics code
[nail scenario capability package] hospital visitor verification