当前位置:网站首页>SwiftUI 手势大全之可用的手势类型有哪些(教程含源码)
SwiftUI 手势大全之可用的手势类型有哪些(教程含源码)
2022-07-29 21:03:00 【知识大胖】
SwiftUI 中可用的手势类型有哪些?
- onTapGesture
- onLongPressGesture
- highPriorityGesture
- simultaneousGesture
- DragGesture
onTapGesture 点击发生时触发
onTapGesture 将在点击发生时触发
Text("Hello, World!")
.onTapGesture() {
print("tapped!")
}
点击Hello, world!文本时输出
tapped!
Double tap Gesture 多次连击
我们只是添加了一些计数onTapGesture,所以当我们点击 == 计数时它会触发
Text("Hello, World!")
.onTapGesture(count: 2) {
print("Double tapped!")
}
点击Hello, world!文本时输出
Double tapped!
onLongPressGesture 长按时会触发
当我们长按时会触发。
Text("Hello, World!")
.onLongPressGesture {
print("Long pressed!")
}
边栏推荐
猜你喜欢

南华早报 | 助力亚洲最具公信力报章实现AD域自动化管理

Second Best PyTorch Beginner Course; Thesis Writing Guide; Using µGo to Develop a Mini Compiler; Super Efficient Use of Transformer's Extension Library; Frontier Papers | ShowMeAI News Daily
![LeetCode 593 Valid Squares [Math] HERODING's Road to LeetCode](/img/c2/34624c9c7693ba40d0b3724c0db611.png)
LeetCode 593 Valid Squares [Math] HERODING's Road to LeetCode

分析少年派2中的Crypto

Setinel 原理简介

336. 回文对

《张卫国的夏天》欢乐来袭,黄磊、刘奕君携手演绎“冤种”兄弟

240. 搜索二维矩阵 II

The demand for VR live broadcast marketing is increasing, and the data module is paving the way for us

940. 不同的子序列 II
随机推荐
LeetCode 593 Valid Squares [Math] HERODING's Road to LeetCode
优惠券系统设计思想
Fully automated machine learning modeling!The effect hangs the primary alchemist!
关于云计算的海量数据存储模型[通俗易懂]
回归——岭回归
Cooler Navigation helps you shop easily in shopping malls without confusion
惠普服务器硬盘指示灯不亮或显示蓝色
怎么实现您的个人知识库?
[ACTF2020 新生赛]Exec 1
容器网络硬核技术内幕 (小结-下)
数组和List互转
The cornerstone of distributed: reliability - What a tangled web we weave
全自动化机器学习建模!效果吊打初级炼丹师!
Panorama Tutorial丨How to shoot sunrise and sunset scenes in VR panoramic shooting?
GET_ENTITYSET Method Implementation Guide for SAP ABAP OData Service Data Provider Class
LeetCode--single linked list--146.LRU cache
如何优雅的自定义 ThreadPoolExecutor 线程池
探索创客教育在线管理实施体系
940. 不同的子序列 II
阿里 P8 爆出的这份大厂面试指南,看完工资暴涨 30k!