当前位置:网站首页>[HarmonyOS] [ARK UI] How to double-click the return key to exit in HarmonyOS ets language
[HarmonyOS] [ARK UI] How to double-click the return key to exit in HarmonyOS ets language
2022-07-30 10:40:00 【51CTO】
参考资料
【Harmony OS】【ARK UI】Date 基本操作
弹窗
代码运行
思路:
定义一个全局变量,判断点击时间与上一次点击时间差,若大于2秒则提示‘再按一次退出程序’字样,小于2秒退出应用,代码如下

运行效果

欲了解更多更全技术文章,欢迎访问 https://developer.huawei.com/consumer/cn/forum/?ha_source=zzh
边栏推荐
- vscode中写markdown格式笔记的配置过程和相关语法
- 【AGC】增长服务2-应用内消息示例
- 在机器人行业的专业人士眼里,机器人行业目前的情况如何?
- Adaptive Control - Simulation Experiment 1 Designing Adaptive Laws Using Lyapunov's Stability Theory
- New in GNOME: Warn users when Secure Boot is disabled
- Array of Shell System Learning
- Matplotlib--plot markers
- Shell system learning function
- BERT pre-training model series summary
- 这种叫什么手法
猜你喜欢

spark udf 接受并处理 null值.

Linux内核设计与实现(十)| 页高速缓存和页回写

【C和指针第七章】可变参数列表

Do you really understand the 5 basic data structures of Redis?

Re16:读论文 ILDC for CJPE: Indian Legal Documents Corpus for Court Judgment Prediction and Explanation

易基因:人类tRNA基因位点表现出与衰老相关的DNA高甲基化|研究文章

Matplotlib--plot markers

Verilog之数码管译码

论文阅读:SegFormer: Simple and Efficient Design for Semantic Segmentation with Transformers

BERT预训练模型系列总结
随机推荐
Day113. Shangyitong: WeChat login QR code, login callback interface
Four ways the Metaverse is changing the way humans work
PyQt5 - draw text on window
死锁的理解
[100个Solidity使用技巧]1、合约重入攻击
(C language) file operation
Flask之路由(app.route)详解
Pytorch中 nn.Transformer的使用详解与Transformer的黑盒讲解
WARN: Establishing SSL connection without server's identity verification is not recommended when connecting to mysql
电压跟随器不要随便加
PyQt5 - draw sine curve with pixels
Container Technology - A Simple Understanding of Kubernetes Objects
what is this method called
105. Construct binary tree from preorder and inorder traversal sequence (video explanation!!)
Security思想项目总结
阿里云OSS对象存储
Re17:读论文 Challenges for Information Extraction from Dialogue in Criminal Law
系统设计精选 | 基于FPGA的CAN总线控制器的设计(附代码)
OC- about alloc and dealloc (haven't started writing yet)
The method of parameter passing