当前位置:网站首页>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!")
}
边栏推荐
猜你喜欢

Analysis of Crypto in Pi 2

南信大提出TIPCB,一个简单但有效的用于基于文本的人员搜索的基于部分的卷积baseline

240. Searching 2D Matrix II

The sword refers to Offer II 097. Number of subsequences

Cobaltstrike and BurpSuite desktop shortcut configuration

TCP协议详解

微信小程序 30 自定义模板和获取用户登录凭证

阿里 P8 爆出的这份大厂面试指南,看完工资暴涨 30k!

OneNote 教程,如何在 OneNote 中做笔记?

回归——分层回归
随机推荐
336. 回文对
940. Different subsequences II
解析掌握现代化少儿编程实操能力
如何优雅的自定义 ThreadPoolExecutor 线程池
378. 有序矩阵中第 K 小的元素
三品牌下半年将带来多款新品,东风日产将迎来“产品大潮”
MySQL数据查询 - 简单查询
4. Implementation Guide for GET_ENTITYSET Method of SAP ABAP OData Service Data Provider Class
SAP ABAP OData 服务 Data Provider Class 的 GET_ENTITYSET 方法实现指南试读版
OneNote 教程,如何在 OneNote 中做笔记?
c#开发知识点总结
MySQL - Design game user information table
分析少年派2中的Crypto
容器网络硬核技术内幕 (小结-下)
[ACTF2020 Freshman Competition]Exec 1
LeetCode--single linked list--146.LRU cache
Dry goods!Cooperative Balance in Federated Learning
嵌入式分享合集24
根据昵称首字母生成头像
MySQL Data Query - Union Query