chinese直男口爆体育生外卖, 99久久er热在这里只有精品99, 又色又爽又黄18禁美女裸身无遮挡, gogogo高清免费观看日本电视,私密按摩师高清版在线,人妻视频毛茸茸,91论坛 兴趣闲谈,欧美 亚洲 精品 8区,国产精品久久久久精品免费

0
  • 聊天消息
  • 系統(tǒng)消息
  • 評論與回復(fù)
登錄后你可以
  • 下載海量資料
  • 學(xué)習(xí)在線課程
  • 觀看技術(shù)視頻
  • 寫文章/發(fā)帖/加入社區(qū)
會員中心
創(chuàng)作中心

完善資料讓更多小伙伴認識你,還能領(lǐng)取20積分哦,立即完善>

3天內(nèi)不再提示

SwipeGesture和RotationGesture手勢

ArkUI詳解 ? 2022-12-07 19:24 ? 次閱讀
加入交流群
微信小助手二維碼

掃碼添加小助手

加入工程師交流群

# SwipeGesture

用于觸發(fā)滑動事件,滑動速度大于100vp/s時可識別成功。

參數(shù)名稱 參數(shù)類型 必填 參數(shù)描述
fingers number 觸發(fā)滑動的最少手指數(shù),默認為1,最小為1指,最大為10指。 默認值:1
direction SwipeDirection 觸發(fā)滑動手勢的滑動方向。 默認值:SwipeDirection.All
speed number 識別滑動的最小速度(默認為100VP/秒)。 默認值:100

SwipeDirection的三個枚舉值

declare enum SwipeDirection {
    /**
     * Default.
     * @since 8
     */
    None,
    /**
     * Sliding horizontally.
     * @since 8
     */
    Horizontal,
    /**
     * Sliding Vertical
     * @since 8
     */
    Vertical,
    /**
     * Sliding in all directions.
     * @since 8
     */
    All
}
  • All:所有方向。
  • Horizontal:水平方向,手指滑動方向與x軸夾角小于45度時觸發(fā)。
  • Vertical:豎直方向,手指滑動方向與y軸夾角小于45度時觸發(fā)。
  • None:任何方向均不可觸發(fā)。

    事件

* Slide gesture recognition success callback.
 * @since 8
 */
onAction(event: (event?: GestureEvent) => void): SwipeGestureInterface;

完整代碼

@Entry
@Component
struct SwipeGestureExample {
  @State rotateAngle: number = 0
  @State speed: number = 1
?
  build() {
    Column() {
      Column() {
        Text("滑動 速度" + this.speed)
        Text("滑動 角度" + this.rotateAngle)
      }
      .border({ width: 3 })
      .width(300)
      .height(200)
      .margin(100)
      .rotate({
?
?
        angle: this.rotateAngle,})
      // 單指豎直方向滑動時觸發(fā)該事件
      .gesture(
      SwipeGesture({
        fingers:2,
        direction: SwipeDirection.All })
        .onAction((event: GestureEvent) => {
          this.speed = event.speed
          this.rotateAngle = event.angle
        })
      )
    }.width('100%')
  }
}

RotationGesture

用于觸發(fā)旋轉(zhuǎn)手勢事件,觸發(fā)旋轉(zhuǎn)手勢的最少手指為2指,最大為5指,最小改變度數(shù)為1度。

數(shù)名稱 參數(shù)類型 必填 參數(shù)描述
fingers number 觸發(fā)旋轉(zhuǎn)的最少手指數(shù), 最小為2指,最大為5指。 默認值:2
angle number 觸發(fā)旋轉(zhuǎn)手勢的最小改變度數(shù),單位為deg。 默認值:1

提供了四種事件

事件

  • ** onActionStart(event: (event?: GestureEvent) => void):Rotation手勢識別成功回調(diào)。**
  • onActionUpdate(event: (event?: GestureEvent) => void):Rotation手勢移動過程中回調(diào)。
  • ** onActionEnd(event: (event?: GestureEvent) => void):Rotation手勢識別成功,手指抬起后觸發(fā)回調(diào)。**
  • ** onActionCancel(event: () => void):Rotation手勢識別成功,接收到觸摸取消事件觸發(fā)回調(diào)。**
* Pan gesture recognition success callback.
     * @since 7
     */
    onActionStart(event: (event?: GestureEvent) => void): RotationGestureInterface;
    /**
     * Callback when the Pan gesture is moving.
     * @since 7
     */
    onActionUpdate(event: (event?: GestureEvent) => void): RotationGestureInterface;
    /**
     * The Pan gesture is successfully recognized. When the finger is lifted, the callback is triggered.
     * @since 7
     */
    onActionEnd(event: (event?: GestureEvent) => void): RotationGestureInterface;
    /**
     * The Pan gesture is successfully recognized and a callback is triggered when the touch cancel event is received.
     * @since 7
     */
    onActionCancel(event: () => void): RotationGestureInterface;
}

完整代碼:

// xxx.ets
@Entry
@Component
struct RotationGestureExample {
  @State angle: number = 0
  @State rotateValue: number = 0
?
  build() {
    Column() {
      Column() {
        Text('旋轉(zhuǎn)角度:' + this.angle)
      }
      .height(200)
      .width(300)
      .padding(20)
      .border({ width: 3 })
      .margin(80)
      .rotate({ angle: this.angle })
      // 雙指旋轉(zhuǎn)觸發(fā)該手勢事件
      .gesture(
      RotationGesture()
        .onActionStart((event: GestureEvent) => {
          console.info('Rotation start')
        })
        .onActionUpdate((event: GestureEvent) => {
          this.angle = this.rotateValue + event.angle
?
        })
        .onActionEnd(() => {
          this.rotateValue = this.angle
          console.info('Rotation end')
        }).onActionCancel(()=>{
        console.info('Rotation onActionCancel')
      })
      )
    }.width('100%')
  }
}

用于觸發(fā)滑動事件,滑動速度大于100vp/s時可識別成功。

參數(shù)名稱 參數(shù)類型 必填 參數(shù)描述
fingers number 觸發(fā)滑動的最少手指數(shù),默認為1,最小為1指,最大為10指。 默認值:1
direction SwipeDirection 觸發(fā)滑動手勢的滑動方向。 默認值:SwipeDirection.All
speed number 識別滑動的最小速度(默認為100VP/秒)。 默認值:100

SwipeDirection的三個枚舉值

declare enum SwipeDirection {
    /**
     * Default.
     * @since 8
     */
    None,
    /**
     * Sliding horizontally.
     * @since 8
     */
    Horizontal,
    /**
     * Sliding Vertical
     * @since 8
     */
    Vertical,
    /**
     * Sliding in all directions.
     * @since 8
     */
    All
}
  • All:所有方向。
  • Horizontal:水平方向,手指滑動方向與x軸夾角小于45度時觸發(fā)。
  • Vertical:豎直方向,手指滑動方向與y軸夾角小于45度時觸發(fā)。
  • None:任何方向均不可觸發(fā)。

    事件

* Slide gesture recognition success callback.
 * @since 8
 */
onAction(event: (event?: GestureEvent) => void): SwipeGestureInterface;

完整代碼

@Entry
@Component
struct SwipeGestureExample {
  @State rotateAngle: number = 0
  @State speed: number = 1
?
  build() {
    Column() {
      Column() {
        Text("滑動 速度" + this.speed)
        Text("滑動 角度" + this.rotateAngle)
      }
      .border({ width: 3 })
      .width(300)
      .height(200)
      .margin(100)
      .rotate({
?
?
        angle: this.rotateAngle,})
      // 單指豎直方向滑動時觸發(fā)該事件
      .gesture(
      SwipeGesture({
        fingers:2,
        direction: SwipeDirection.All })
        .onAction((event: GestureEvent) => {
          this.speed = event.speed
          this.rotateAngle = event.angle
        })
      )
    }.width('100%')
  }
}

RotationGesture

用于觸發(fā)旋轉(zhuǎn)手勢事件,觸發(fā)旋轉(zhuǎn)手勢的最少手指為2指,最大為5指,最小改變度數(shù)為1度。

數(shù)名稱 參數(shù)類型 必填 參數(shù)描述
fingers number 觸發(fā)旋轉(zhuǎn)的最少手指數(shù), 最小為2指,最大為5指。 默認值:2
angle number 觸發(fā)旋轉(zhuǎn)手勢的最小改變度數(shù),單位為deg。 默認值:1

提供了四種事件

事件

  • ** onActionStart(event: (event?: GestureEvent) => void):Rotation手勢識別成功回調(diào)。**
  • onActionUpdate(event: (event?: GestureEvent) => void):Rotation手勢移動過程中回調(diào)。
  • ** onActionEnd(event: (event?: GestureEvent) => void):Rotation手勢識別成功,手指抬起后觸發(fā)回調(diào)。**
  • ** onActionCancel(event: () => void):Rotation手勢識別成功,接收到觸摸取消事件觸發(fā)回調(diào)。**
* Pan gesture recognition success callback.
     * @since 7
     */
    onActionStart(event: (event?: GestureEvent) => void): RotationGestureInterface;
    /**
     * Callback when the Pan gesture is moving.
     * @since 7
     */
    onActionUpdate(event: (event?: GestureEvent) => void): RotationGestureInterface;
    /**
     * The Pan gesture is successfully recognized. When the finger is lifted, the callback is triggered.
     * @since 7
     */
    onActionEnd(event: (event?: GestureEvent) => void): RotationGestureInterface;
    /**
     * The Pan gesture is successfully recognized and a callback is triggered when the touch cancel event is received.
     * @since 7
     */
    onActionCancel(event: () => void): RotationGestureInterface;
}

完整代碼:

// xxx.ets
@Entry
@Component
struct RotationGestureExample {
  @State angle: number = 0
  @State rotateValue: number = 0
?
  build() {
    Column() {
      Column() {
        Text('旋轉(zhuǎn)角度:' + this.angle)
      }
      .height(200)
      .width(300)
      .padding(20)
      .border({ width: 3 })
      .margin(80)
      .rotate({ angle: this.angle })
      // 雙指旋轉(zhuǎn)觸發(fā)該手勢事件
      .gesture(
      RotationGesture()
        .onActionStart((event: GestureEvent) => {
          console.info('Rotation start')
        })
        .onActionUpdate((event: GestureEvent) => {
          this.angle = this.rotateValue + event.angle
?
        })
        .onActionEnd(() => {
          this.rotateValue = this.angle
          console.info('Rotation end')
        }).onActionCancel(()=>{
        console.info('Rotation onActionCancel')
      })
      )
    }.width('100%')
  }
}
聲明:本文內(nèi)容及配圖由入駐作者撰寫或者入駐合作網(wǎng)站授權(quán)轉(zhuǎn)載。文章觀點僅代表作者本人,不代表電子發(fā)燒友網(wǎng)立場。文章及其配圖僅供工程師學(xué)習(xí)之用,如有內(nèi)容侵權(quán)或者其他違規(guī)問題,請聯(lián)系本站處理。 舉報投訴
  • 手勢識別
    +關(guān)注

    關(guān)注

    8

    文章

    228

    瀏覽量

    48283
  • 觸摸
    +關(guān)注

    關(guān)注

    8

    文章

    199

    瀏覽量

    64972
  • OpenHarmony
    +關(guān)注

    關(guān)注

    29

    文章

    3851

    瀏覽量

    18582
  • OpenHarmony3.1
    +關(guān)注

    關(guān)注

    0

    文章

    11

    瀏覽量

    663
收藏 人收藏
加入交流群
微信小助手二維碼

掃碼添加小助手

加入工程師交流群

    評論

    相關(guān)推薦
    熱點推薦

    紅外手勢識別方案 紅外手勢感應(yīng)模塊 紅外識別紅外手勢識別

    紅外手勢識別方案,適用于多種領(lǐng)域,如音響,可實現(xiàn)通過手勢識別暫停,開始,上一首,下一首;智能家居,如電動窗簾,感應(yīng)馬桶等;電子產(chǎn)品,如臺燈開關(guān)以及亮度的調(diào)節(jié)。
    發(fā)表于 08-27 16:37

    Android 手勢識別

    本帖最后由 kiter_rp 于 2014-9-11 14:23 編輯 總體來分析手勢有關(guān)涉及到手勢匹配相關(guān)的源碼類之間的關(guān)系,如下圖: 上圖中的相關(guān)類簡介:GestureLibrary:手勢
    發(fā)表于 09-11 14:22

    使用SensorTile識別手勢

    你好, 我正在嘗試使用SensorTile實現(xiàn)手勢識別,開發(fā)我的固件我開始研究BlueMicrosystem2示例,因此我能夠檢測到簡單的手勢作為手腕的方向?,F(xiàn)在我想要認識一些更復(fù)雜的手勢,比如
    發(fā)表于 09-10 17:18

    手勢識別控制器制作

    目錄智能家居硬件小制作(含源碼)《手勢識別控制器》基于PAJ7620手勢模塊、L298N驅(qū)動板、arduino介紹材料PAJ7620手勢模塊參數(shù)硬件連接庫文件使用其他硬件制作手勢識別控
    發(fā)表于 09-07 06:45

    HarmonyOS應(yīng)用API手勢方法-綁定手勢方法

    述:為組件綁定不同類型的手勢事件,并設(shè)置事件的響應(yīng)方法。Api:從API Version 7開始支持一、綁定手勢識別:通過如下屬性給組件綁定手勢識別,手勢識別成功后可以通過事件回調(diào)通知
    發(fā)表于 11-23 15:53

    HarmonyOS應(yīng)用API手勢方法-RotationGesture

    描述:用于觸發(fā)旋轉(zhuǎn)手勢事件,觸發(fā)旋轉(zhuǎn)手勢的最少手指為2指,最大為5指,最小改變度數(shù)為1度。Api:從API Version 7開始支持接口:RotationGesture(value?: &
    發(fā)表于 11-30 10:42

    HarmonyOS應(yīng)用API手勢方法-RotationGesture

    描述:用于觸發(fā)旋轉(zhuǎn)手勢事件,觸發(fā)旋轉(zhuǎn)手勢的最少手指為2指,最大為5指,最小改變度數(shù)為1度。Api:從API Version 7開始支持接口:RotationGesture(value?: &
    發(fā)表于 11-30 10:43

    HarmonyOS應(yīng)用API手勢方法-SwipeGesture

    描述:用于觸發(fā)滑動事件,滑動最小速度為100vp/s時識別成功。Api:從API Version 8開始支持接口:SwipeGesture(value?: { fingers
    發(fā)表于 12-01 17:29

    HarmonyOS/OpenHarmony(Stage模型)應(yīng)用開發(fā)單一手勢(三)

    五、旋轉(zhuǎn)手勢RotationGesture) .RotationGesture(value?:{fingers?:number; angle?:number}) 旋轉(zhuǎn)手勢用于觸發(fā)旋轉(zhuǎn)
    發(fā)表于 09-06 14:14

    HarmonyOS/OpenHarmony(Stage模型)應(yīng)用開發(fā)組合手勢(三)互斥識別

    的觸發(fā)條件為滑動距離達到5vp,先達到觸發(fā)條件的手勢觸發(fā)??梢酝ㄟ^修改SwipeGesture和PanGesture的參數(shù)以達到不同的效果。
    發(fā)表于 09-11 15:01

    基于加鎖機制的靜態(tài)手勢識別運動中的手勢

    基于 RGB-D( RGB-Depth)的靜態(tài)手勢識別的速度高于其動態(tài)手勢識別,但是存在冗余手勢和重復(fù)手勢而導(dǎo)致識別準確性不高的問題。針對該問題,提出了一種基于加鎖機制的靜態(tài)
    發(fā)表于 12-15 13:34 ?0次下載
    基于加鎖機制的靜態(tài)<b class='flag-5'>手勢</b>識別運動中的<b class='flag-5'>手勢</b>

    混合交互手勢模型設(shè)計

    分析了觸控交互技術(shù)在移動手持設(shè)備及可穿戴設(shè)備的應(yīng)用現(xiàn)狀及存在的問題.基于交互動作的時間連續(xù)性及空間連續(xù)性。提出了將觸控交互動作的接觸面軌跡與空間軌跡相結(jié)合。同時具有空中手勢及觸控手勢的特性及優(yōu)點
    發(fā)表于 12-26 11:15 ?0次下載
    混合交互<b class='flag-5'>手勢</b>模型設(shè)計

    手勢識別技術(shù)及其應(yīng)用

    手勢識別技術(shù)是一種通過計算機視覺和人工智能技術(shù)來分析和識別人類手勢動作的技術(shù)。它主要利用傳感器、攝像頭等設(shè)備捕捉手勢信息,然后通過算法對捕捉到的手勢信息進行處理和分析,從而實現(xiàn)對
    的頭像 發(fā)表于 06-14 18:12 ?2854次閱讀

    OpenHarmony實戰(zhàn)開發(fā)-手勢事件

    手勢表示由單個或多個事件識別的語義動作(例如:點擊、拖動和長按)。一個完整的手勢也可能由多個事件組成,對應(yīng)手勢的生命周期。支持的事件有:
    的頭像 發(fā)表于 04-29 13:57 ?589次閱讀

    鴻蒙ArkTS聲明式開發(fā):跨平臺支持列表RotationGesture之基礎(chǔ)手勢

    用于觸發(fā)旋轉(zhuǎn)手勢事件,觸發(fā)旋轉(zhuǎn)手勢的最少手指為2指,最大為5指,最小改變度數(shù)為1度。
    的頭像 發(fā)表于 06-18 09:27 ?631次閱讀
    鴻蒙ArkTS聲明式開發(fā):跨平臺支持列表<b class='flag-5'>RotationGesture</b>之基礎(chǔ)<b class='flag-5'>手勢</b>