当前位置:网站首页>Swiftui component encyclopedia creating animated 3D card scrolling effects using Scrollview and geometryreader
Swiftui component encyclopedia creating animated 3D card scrolling effects using Scrollview and geometryreader
2022-06-23 03:40:00 【Knowledge fatness】
Card view

Start with the card , We will create a structure view with colors and numbers . These cards will RoundedRectangles Has a fill color and a Text View , The numbers are stacked in one ZStack.
I have a background attribute ,RoundedRectangle It uses white as the view . This is because I am for CardView The opacity attribute value is 0.3 Give color to the object . If you use an opacity value of 1.0 The color of the , No background color is required .
struct CardView: View {
let num : Int
let color : Color
var body: some View {
ZStack {
RoundedRectangle(cornerRadius: 20)
.fill(self.color)
.shadow(color: self.color.opacity(1), radius: 10)
.background(Color.white)
.frame(width: 230, height: 250)
Text("\(self.num)")
.font(.system(size: 35))
.bold()
}
}
}
Content view
Include the ContentView Color array CardView. Choose your color or create another type of array and fill it with what you will include in the card :
var colors = [Color.re边栏推荐
- Simple analysis of easygbs compatible with old version HLS streaming address method [with code]
- The power of code refactoring: how to measure the success of refactoring
- What is the difference between the poll () method and the remove () method?
- How to share small programs released by wechat
- 【LeetCode】23. 合并K个升序链表
- 数据交易怎样实现
- Cross tenant data integration link connection
- JS array de duplication, removing the same value
- Firewall and IP security policy configuration
- 软件项目管理 8.4.软件项目质量计划
猜你喜欢

【曾书格激光SLAM笔记】Gmapping基于滤波器的SLAM

LRU cache
![Analysis of the number of urban residents covered by basic medical insurance, their treatment and medical treatment in other places in China in 2021 [figure]](/img/81/4d3cb059f700dd9243645e64023be7.jpg)
Analysis of the number of urban residents covered by basic medical insurance, their treatment and medical treatment in other places in China in 2021 [figure]

【二分】leetcode1011. Capacity To Ship Packages Within D Days

MySQL common instructions

【owt】owt-client-native-p2p-e2e-test vs2017构建 4 : 第三方库的构建及链接p2pmfc.exe
![[OWT] OWT client native P2P E2E test vs2017 build 2: test unit construction and operation](/img/b0/4ea8069a88ce19ca7dbfa67ac9fcba.png)
[OWT] OWT client native P2P E2E test vs2017 build 2: test unit construction and operation

【owt】owt-client-native-p2p-e2e-test vs2017构建2 :测试单元构建及运行

Banknext microservice: a case study

冒泡排序法
随机推荐
Stress testing with locust on rainbow
[advanced Android] entrusted by kotlin
innodb_ruby 视角下 MySQL 记录增删改
[burning] Tencent cloud high tech computing platform HTPC cloud elastic cluster release!
【LeetCode】两数之和II
mysql 数据恢复 (.ibdata1, bin log)
How to print multiple barcode labels on one sheet of paper
New configuration of Alipay
Fetch request details
Is LinkedList a one-way linked list or a two-way linked list?
MySQL common instructions
Gakataka student end to bundle Version (made by likewendy)
【曾书格激光SLAM笔记】Gmapping基于滤波器的SLAM
Analysis of China's integrated circuit industry chain in 2021: huge downstream market demand [figure]
聊聊内存模型和内存序
Know res.send() and res.end() of Express
Quickly understand the development status of secondary nodes of industrial Internet identity analysis
数据加密技术之源代码加密
Analysis on the development status of China's watch industry in 2021: a large number of electric watches are imported [figure]
1058 multiple choice questions (20 points)