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

智慧树网站的章节题做不了太原百度推广排名优化

智慧树网站的章节题做不了,太原百度推广排名优化,网站制作论文题目,网络营销案例分析与实践真题上篇回顾:ArkTS开发系列之事件(2.8.1触屏、键鼠、焦点事件) 本篇内容:ArkTS开发系列之事件(2.8.2手势事件) 一、绑定手势方法 1. 常规手势绑定方法 Text(手势).fontSize(44).gesture(TapGesture().onAct…

上篇回顾:ArkTS开发系列之事件(2.8.1触屏、键鼠、焦点事件)

本篇内容:ArkTS开发系列之事件(2.8.2手势事件)

一、绑定手势方法

1. 常规手势绑定方法

 Text('手势').fontSize(44).gesture(TapGesture().onAction((event) => {console.error('event: ' + JSON.stringify(event))}))

2. 带优先级的手势绑定方法

  • 需要注意,子父组件绑定相同级别手势时,子组件优先响应,如果父组件绑定优先级手势方法,子组件为普通绑定手势方法,则父组件优先响应
    .priorityGesture(TapGesture().onAction((event)=>{console.error('parentGesture: ' + JSON.stringify(event))}))

3. 并行手势绑定方法

  • 当父组件绑定此手势方法时,父子组件可同时响应手势
    .parallelGesture(TapGesture().onAction((event)=>{console.error('parent event: ' + JSON.stringify(event))}))

二、单一手势

1. 点击手势(tapGesture)

      Text('手势').fontSize(44).gesture(TapGesture().onAction((event) => {console.error('event: ' + JSON.stringify(event))}))

2. 长按手势(longPressGesture)

LongPressGesture(value?:{fingers?:number; repeat?:boolean; duration?:number})
  • fingers :触发最少手指数,默认1
  • repeat 是否连续触发 默认false
  • duration 长按多久触发,默认500
Text('长按手势').fontSize(55).gesture(LongPressGesture({fingers: 1, repeat: true, duration: 300})//fingers :触发最少手指数,默认1  repeat 是否连续触发 默认false  duration 长按多久触发,默认500.onAction(event=>{console.error('longPress: ' + JSON.stringify(event))}))

3. 拖动手势(PanGesture)

PanGesture(value?:{ fingers?:number; direction?:PanDirection; distance?:number})
  • fingers: 触发手势最少手指数,默认1
  • direction:触发手势方向,默认值Pandirection.All
  • distance:触发手势的最少距离,单位为vp,默认5vp
  • 有点类似于onTouch事件
  Text('拖动手势').fontSize(44).gesture(PanGesture().onActionStart(event => {console.error('Pan start: ' + JSON.stringify(event))}).onActionUpdate(event => {console.error('Pan update: ' + JSON.stringify(event))}).onActionEnd(event => {console.error('Pan end: ' + JSON.stringify(event))}).onActionCancel(() => {console.error('Pan cancel: ')}))

4. 撮合手势(PinchGesture)

PinchGesture(value?:{fingers?:number; distance?:number})
  • fingers: 触发手势最少手指数,默认2, 最大值为5
  • distance:触发手势的最少距离,单位为vp,默认5vp
      Text('撮合手势').fontSize(44).gesture(PinchGesture().onActionStart(event => {console.error('Pinch start: ' + JSON.stringify(event))}).onActionUpdate(event => {console.error('Pinch update: ' + JSON.stringify(event))}).onActionEnd(event => {console.error('Pinch end: ' + JSON.stringify(event))}).onActionCancel(() => {console.error('Pinch cancel: ')}))

5. 旋转手势(RotationGesture)

RotationGesture(value?:{fingers?:number; angle?:number})
  • fingers: 触发手势最少手指数,默认2, 最大值为5
  • angle: 触发手势的最小改变度数,单位是deg,默认为1deg
 Text().fontSize(44).gesture(RotationGesture({fingers:2}).onActionStart(event => {console.error('Rotation start: ' + JSON.stringify(event))}).onActionUpdate(event => {console.error('Rotation update: ' + JSON.stringify(event))}).onActionEnd(event => {console.error('Rotation end: ' + JSON.stringify(event))}).onActionCancel(() => {console.error('Rotation cancel: ')}))

6. 滑动手势(SwipeGesture)

SwipeGesture(value?:{fingers?:number; direction?:SwipeDirection; speed?:number})
  • fingers: 触发手势最少手指数,默认1, 最大值为10
  • direction: 触发手势的方向默认值是 SwipeDirection.All
  • speed: 触发手势的最小滑动速度,单位为vp/s,默认值为100vp/s
    .gesture(SwipeGesture({ direction: SwipeDirection.Vertical }).onAction(event => {console.error('Swipe : ' + JSON.stringify(event))}))

三、组合手势

GestureGroup(mode:GestureMode, ...gesture:GestureType[])

mode: 声明组合手势的类型
gesture: 手势数组

1. 顺序组合

    .gesture(GestureGroup(GestureMode.Sequence,SwipeGesture({ direction: SwipeDirection.Vertical }).onAction(event => {console.error('Swipe : ' + JSON.stringify(event))}),LongPressGesture().onAction(event => {console.error('longPress : ' + JSON.stringify(event))})))

2. 并行组合

    .gesture(GestureGroup(GestureMode.Parallel,SwipeGesture({ direction: SwipeDirection.Vertical }).onAction(event => {console.error('Swipe : ' + JSON.stringify(event))}),LongPressGesture().onAction(event => {console.error('longPress : ' + JSON.stringify(event))})))

3. 互斥组合

    .gesture(GestureGroup(GestureMode.Exclusive,SwipeGesture({ direction: SwipeDirection.Vertical }).onAction(event => {console.error('Swipe : ' + JSON.stringify(event))}),LongPressGesture().onAction(event => {console.error('longPress : ' + JSON.stringify(event))})))
http://www.hrbkazy.com/news/37259.html

相关文章:

  • 网站中的分享怎么做yahoo搜索引擎提交入口
  • 夺宝网站怎样做优化商丘seo外包
  • 网站正在建设中代码百度seo优化服务项目
  • 互联网公司排名2019宁波seo在线优化方案
  • 微信开发网站开发互联网营销案例
  • wordpress 怎么转英语山西seo和网络推广
  • 百度竞价推广属于什么广告seo免费入门教程
  • 如何做网站支付接口东莞网站制作公司联系方式
  • 辛集建设局官方网站今日军事新闻
  • 做设计的地图网站有哪些网站排名优化推广
  • 自己做的网站怎么接入网页游戏seo查询在线
  • 南京网站定制公司网页设计代码
  • 有个找人做任务赚返佣的网站站长之家查询网
  • 重庆网站建设公司那好域名备案查询站长工具
  • 企业网站制作一般多少钱如何优化网页加载速度
  • 有没有专门做本子的网站百度如何精准搜索
  • 湘潭网站建设湘潭振企专业中山百度seo排名公司
  • 网站系统建设百度平台推广的营销收费模式
  • 网站建设广告合同需要交印花税吗调价智能关键词软件
  • 电脑网络seo优化专员招聘
  • 做个爬架网站如何做买卖网站
  • PHP网站开发用什么电脑备案域名查询
  • 人性本私wordpress广州百度seo代理
  • wordpress 插件汉化seo网页优化培训
  • 做实验室信息的网站网络推广整合平台
  • 医疗类网站备案2024年重大政治时事汇总
  • 做淘宝客如何引出图片到网站成都网站建设企业
  • 男生和女生做污的事情免费网站域名是什么 有什么用
  • 怎么才能建立一个网站2023年免费进入b站
  • 温州做网站就来温州易富网络全网营销一站式推广