当前位置: 首页 > news >正文

鸿蒙next 点击穿透实现

点击穿透可以参考华为开发的保留文章,该章节只能在developer preview版本下查看
点击穿透
主要的方法是hitTestBehavior
在这里插入图片描述

// xxx.ets
@Entry
@Component
struct HitTestBehaviorExample {build() {// outer stackStack() {Button('outer button').onTouch((event) => {console.info('outer button touched type: ' + (event as TouchEvent).type)})// inner stackStack() {Button('inner button').onTouch((event) => {console.info('inner button touched type: ' + (event as TouchEvent).type)})}.width("100%").height("100%").hitTestBehavior(HitTestMode.Block).onTouch((event) => {console.info('stack touched type: ' + (event as TouchEvent).type)})Text('Transparent').hitTestBehavior(HitTestMode.Transparent).width("100%").height("100%").onTouch((event) => {console.info('text touched type: ' + (event as TouchEvent).type)})}.width(300).height(300)}
}
http://www.lryc.cn/news/543167.html

相关文章:

  • OpenAPI Generator:API开发的瑞士军刀
  • 某住宅小区地下车库安科瑞的新能源汽车充电桩的配电设计与应用方案 安科瑞 耿笠
  • 电子科技大学考研复习经验分享
  • 2025面试Go真题第一场
  • 【量化策略】趋势跟踪策略
  • leetcode 541. 反转字符串 II 简单
  • org.springframework.boot不存在的其中一个解决办法
  • AI绘画软件Stable Diffusion详解教程(2):Windows系统本地化部署操作方法(专业版)
  • MySql数据库运维学习笔记
  • Linux中Shell运行原理和权限(下)(4)
  • LeetCode热题100- 字符串解码【JavaScript讲解】
  • 每日一题——LRU缓存机制的C语言实现详解
  • Leetcode3162:优质数对的总数 I
  • docker安装etcd:docker离线安装etcd、docker在线安装etcd、etcd镜像下载、etcd配置详解、etcd常用命令、安装常见问题总结
  • Apache SeaTunnel 构建实时数据同步管道(最新版)
  • 递归、搜索与回溯第二讲:二叉树中的深搜 穷举vs暴搜vs深搜vs回溯vs剪枝
  • Hbase分布式——储存机制
  • Word表格中如何只单独调整某一单元格宽度
  • Build错误:Cannot determine build data storage root for project 和 无法加载主类的解决办法的经验分享
  • 【Springboot知识】Logback从1.2.x升级到1.3.x需要注意哪些点?
  • 大语言加持的闭环端到端自动驾驶模型 学习笔记纯干货
  • 初阶数据结构(C语言实现)——2算法的时间复杂度和空间复杂度
  • MySQL知识
  • 【前端定位线上问题的多种方案(不依赖 Sentry)】
  • 怎么修改node_modules里的文件,怎么使用patch-package修改node_modules的文件,怎么修改第三方库原文件。
  • muduo网络库2
  • 什么是DrawCall?DrawCall为什么会影响游戏运行效率?如何减少DrawCall?
  • LabVIEW电能质量分析软件
  • 【十二】Golang 映射
  • PHP商协会管理系统小程序源码