当前位置:网站首页>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边栏推荐
- 【贪心】leetcode991. Broken Calculator
- Decentralized networks are not decentralized
- 【LeetCode】179. 最大数
- Analysis on the development of China's graphene industry chain in 2021: with the support of energy conservation and environmental protection policies, the scale of graphene industry will continue to e
- [advanced Android] kotlin delegate attribute
- Regeorg actual attack and defense
- D overloading nested functions
- mysql 数据恢复 (.ibdata1, bin log)
- The power of code refactoring: how to measure the success of refactoring
- [burning] Tencent cloud high tech computing platform HTPC cloud elastic cluster release!
猜你喜欢
![[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

1-1VMware介绍

mysql常用指令

Hierarchical attention graph convolution network for interpretable recommendation based on knowledge graph

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

MySQL common instructions

Fetch request details

软件项目管理 8.4.软件项目质量计划

Insert sort directly

centos7 安装 MySQL 及配置 innodb_ruby
随机推荐
How to get started with apiccloud app and multi terminal development of applet based on zero Foundation
【LeetCode】23. Merge K ascending linked lists
Cross tenant data integration link connection
The MIUI 13 development version of Xiaomi mobile phone blocks the chrome application and cannot be opened after installation
Minecraft server technology explanation 𞓜 teach you how to get to the ashes from Xiaobai -- server technology explanation
WordPress modifying fixed links and pseudo statics
Static code block, code block, constructor execution order
What is the difference between the poll () method and the remove () method?
[OWT] OWT client native P2P E2E test vs2017 build 2: test unit construction and operation
Know res.send() and res.end() of Express
How to store easydss version 3.0 video files in other free disks?
LRU cache
【二叉树】993. Cousins in Binary Tree
What is the difference between comparator and comparable?
Simply use the pagoda to build WordPress
R tree of search tree
RTOS system selection for charging point software design
What is the difference between ArrayList and LinkedList?
直接插入排序
The compatibility of remotefx schemes is related to multiple factors