当前位置:网站首页>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边栏推荐
- 【曾书格激光SLAM笔记】Gmapping基于滤波器的SLAM
- Cross tenant data integration link connection
- JS array de duplication, removing the same value
- [burning] Tencent cloud high tech computing platform HTPC cloud elastic cluster release!
- The MIUI 13 development version of Xiaomi mobile phone blocks the chrome application and cannot be opened after installation
- 软件项目管理 8.4.软件项目质量计划
- mysql 数据恢复 (.ibdata1, bin log)
- Easysearcher cannot find the IP address of easynvr hardware. How to solve it?
- Not just offline caching- On how to make good use of serviceworker
- 【二分】leetcode1011. Capacity To Ship Packages Within D Days
猜你喜欢

Gakataka student end to bundle Version (made by likewendy)

第一批00后下场求职:不要误读他们的“不一样”

R tree of search tree

Using jhipster to build microservice architecture

选择排序法

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

【贪心】leetcode991. Broken Calculator

Analysis on the development of duty-free industry in Hainan Province in 2021: the implementation of the new policy makes the duty-free market in Hainan more "prosperous" [figure]
![[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
![Analysis on the development prospect of China's brain computer interface industry in 2021: wide application prospect, sustained and rapid growth of market scale [figure]](/img/84/192d152ceb760264b6b555b321f129.jpg)
Analysis on the development prospect of China's brain computer interface industry in 2021: wide application prospect, sustained and rapid growth of market scale [figure]
随机推荐
[OWT] OWT client native P2P E2E test vs2017 build 3: no test unit comparison, manually generate vs projects
Simple analysis of easygbs compatible with old version HLS streaming address method [with code]
[advanced Android] entrusted by kotlin
Preliminary sequencing problem
What is the difference between ArrayList and LinkedList?
What is the reason why anonymous live OBS streaming is successful but flv video cannot be played?
What are the advantages of the completely free and open source flutter? How to learn about flutter?
Engineer culture: should the company buy genuine software
Source code encryption of data encryption technology
直接插入排序
Gakataka student end to bundle Version (made by likewendy)
纳瓦尔宝典:不靠运气致富的原则
Brief introduction to arm architecture
Analysis on demand and market scale of China's steamed stuffed bun industry in 2020 [figure]
ABCD identifier of SAP mm initial cycle count
Insert sort directly
Is LinkedList a one-way linked list or a two-way linked list?
Analysis on the development status of China's watch industry in 2021: a large number of electric watches are imported [figure]
How to share small programs released by wechat
Record an edusrc vulnerability mining