在线观看www成人影院-在线观看www日本免费网站-在线观看www视频-在线观看操-欧美18在线-欧美1级

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

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

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

鴻蒙Ability Kit(程序框架服務(wù))【UIAbility內(nèi)和UIAbility間頁面的跳轉(zhuǎn)】

jf_46214456 ? 來源:jf_46214456 ? 作者:jf_46214456 ? 2024-06-03 14:13 ? 次閱讀

UIAbility內(nèi)和UIAbility間頁面的跳轉(zhuǎn)(ArkTS)

介紹

本篇Codelab基于Stage模型下的UIAbility開發(fā),實(shí)現(xiàn)UIAbility內(nèi)和UIAbility間頁面的跳轉(zhuǎn)。包含如下功能:

  1. UIAbility內(nèi)頁面的跳轉(zhuǎn)。
  2. 跳轉(zhuǎn)到指定UIAbility的首頁。
  3. 跳轉(zhuǎn)到指定UIAbility的指定頁面(非首頁)。

最終效果圖如下:

相關(guān)概念

  • [UIAbility組件概述]:UIAbility組件是一種包含UI界面的應(yīng)用組件,主要用于和用戶交互。UIAbility組件是系統(tǒng)調(diào)度的基本單元,為應(yīng)用提供繪制界面的窗口。一個應(yīng)用可以包含一個或多個UIAbility組件。
  • [UIAbilityContext]:UIAbilityContext是[UIAbility]的上下文環(huán)境,繼承自[Context],提供UIAbility的相關(guān)配置信息以及操作UIAbility和ServiceExtensionAbility的方法。
  • [頁面路由]:提供通過不同的url訪問不同的頁面,包括跳轉(zhuǎn)到應(yīng)用內(nèi)的指定頁面、用應(yīng)用內(nèi)的某個頁面替換當(dāng)前頁面、返回上一頁面或指定的頁面等。
  • [Text]:文本組件,用于呈現(xiàn)一段文本信息。
  • [Button]:按鈕組件,可快速創(chuàng)建不同樣式的按鈕。
  • 開發(fā)前請熟悉鴻蒙開發(fā)指導(dǎo)文檔 :[gitee.com/li-shizhen-skin/harmony-os/blob/master/README.md]

環(huán)境搭建

軟件要求

  • [DevEco Studio]版本:DevEco Studio 3.1 Release。
  • OpenHarmony SDK版本:API version 9。

硬件要求

  • 開發(fā)板類型:[潤和RK3568開發(fā)板]。
  • OpenHarmony系統(tǒng):3.2 Release。

環(huán)境搭建

完成本篇Codelab我們首先要完成開發(fā)環(huán)境的搭建,本示例以RK3568開發(fā)板為例,參照以下步驟進(jìn)行:

  1. [獲取OpenHarmony系統(tǒng)版本]:標(biāo)準(zhǔn)系統(tǒng)解決方案(二進(jìn)制)。以3.2 Release版本為例:
  2. 搭建燒錄環(huán)境。
    1. [完成DevEco Device Tool的安裝]
    2. [完成RK3568開發(fā)板的燒錄]
  3. 搭建開發(fā)環(huán)境。
    1. 開始前請參考[工具準(zhǔn)備],完成DevEco Studio的安裝和開發(fā)環(huán)境配置。
    2. 開發(fā)環(huán)境配置完成后,請參考[使用工程向?qū)創(chuàng)建工程(模板選擇“Empty Ability”)。
    3. 工程創(chuàng)建完成后,選擇使用[真機(jī)進(jìn)行調(diào)測])。

代碼結(jié)構(gòu)解讀

本篇Codelab只對核心代碼進(jìn)行講解,完整代碼可以直接從gitee獲取。

├──device/src/main/ets              // device模塊的代碼區(qū)
│  ├──pages
│  │  ├──Index.ets                  // SecondAbility的Index頁面
│  │  └──Second.ets                 // SecondAbility的Second頁面
│  ├──secondability
│  │  └──SecondAbility.ets          // 程序入口類
├──device/src/main/resources        // device模塊的資源文件目錄
├──entry/src/main/ets               // entry模塊的代碼區(qū)
│  ├──common
│  │  ├──constants
│  │  │  ├──CommonConstants.ets     // 公共常量類
│  │  │  └──StyleConstants.ets	    // 樣式常量類
│  │  ├──utils
│  │  │  ├──GlobalContext.ets       // 全局變量控制類
│  │  │  └──Logger.ets	            // 日志打印類
│  ├──entryability
│  │  └──EntryAbility.ts            // 程序入口類
│  ├──model
│  │  └──ButtonClickMethod.ets      // 按鈕點(diǎn)擊后調(diào)用的方法類
│  ├──pages
│  │  ├──Index.ets                  // EntryAbility的Index頁面
│  │  └──Second.ets                 // EntryAbility的Second頁面
└──entry/src/main/resources         // entry模塊的資源文件目錄

UIAbility內(nèi)頁面的跳轉(zhuǎn)

entry模塊中,EntryAbility內(nèi)頁面的跳轉(zhuǎn)可以通過頁面路由router來實(shí)現(xiàn)。頁面路由router根據(jù)頁面url找到目標(biāo)頁面,從而實(shí)現(xiàn)跳轉(zhuǎn)。效果圖如下:

  1. 實(shí)現(xiàn)UIAbility內(nèi)頁面的跳轉(zhuǎn),我們首先需要構(gòu)建兩個頁面。在“Project”窗口,點(diǎn)擊“entry > src > main > ets > pages”,打開“Index.ets”文件,可以看到EntryAbility的Index頁面由一個Image組件、兩個Text組件、三個Button組件組成。“Index.ets”文件的示例代碼如下:

    @Entry
    @Component
    struct Index {
      @State text: string = '';
      @State bottomMargin: string = StyleConstants.MAIN_INDEX_BUTTON_MARGIN_BOTTOM;
    
      build() {
        Column() {
          Image($r('app.media.right'))
            ...
    
          Text($r('app.string.main_index_page_name'))
            ...
    
          // 條件渲染:當(dāng)text的值不為空時,顯示該組件
          if (this.text !== '') {
            Text(this.text)
              ...
          }
    
          // 導(dǎo)航到EntryAbility的Second Page
          Button($r('app.string.to_main_second_page_btn_text'), { type: ButtonType.Capsule, stateEffect: true })
            ...
    
          // 導(dǎo)航到SecondAbility的Index Page
          Button($r('app.string.to_second_index_page_btn_text'), { type: ButtonType.Capsule, stateEffect: true })
            ...
    
          // 導(dǎo)航到SecondAbility的Second Page
          Button($r('app.string.to_second_second_page_btn_text'), { type: ButtonType.Capsule, stateEffect: true })
            ...
        }
        ...
      }
    }
    
  2. 在“Project”窗口,打開“entry > src > main > ets”,右鍵點(diǎn)擊“pages”文件夾,選擇“New > Page”,命名為“Second”。可以看到EntryAbility的Second頁面由一個Image組件、兩個Text組件、一個Button組件組成。“Second.ets”文件的示例代碼如下:

    @Entry
    @Component
    struct Second {
      ...
    
      build() {
        Column() {
          Image($r('app.media.left'))
            ...
    
          Text($r('app.string.main_second_page_name'))
            ...
    
          Text(`${this.src}:${this.count}`)
            ...
    
          // 返回到EntryAbility的Index Page
          Button($r('app.string.back_main_index_page_btn_text'), { type: ButtonType.Capsule, stateEffect: true })
            ...
        }
        ...
      }
    }
    
  3. 從entry模塊的Index頁面跳轉(zhuǎn)到Second頁面,并進(jìn)行數(shù)據(jù)傳遞,通過頁面路由router來實(shí)現(xiàn)。需要如下幾個步驟:

    • 給兩個頁面導(dǎo)入router模塊。
    • 在EntryAbility的Index頁面中,點(diǎn)擊“導(dǎo)航到EntryAbility的Second Page”按鈕后,調(diào)用ButtonClickMethod類中的toEntryAbilitySecond方法,跳轉(zhuǎn)到EntryAbility的Second頁面。使用router.pushUrl實(shí)現(xiàn)跳轉(zhuǎn),可以通過params來向新頁面?zhèn)魅雲(yún)?shù),示例代碼如下:
    // 導(dǎo)入router模塊
    import router from '@ohos.router';
    
    // 導(dǎo)航到EntryAbility的Second Page
    toEntryAbilitySecond() {
      router.pushUrl({
        url: 'pages/Second',
        params: {
          src: textMessage,
          count: CommonConstants.NUM_VALUES[0]
        }
      });
    }
    
    • Second頁面通過router.getParams()方法獲取Index頁面?zhèn)鬟f過來的自定義參數(shù),并用一個Text文本展示從Index頁面?zhèn)鬟f過來的數(shù)據(jù),示例代碼如下:
    @Entry
    @Component
    struct Second {
      ...
      // 獲取Index頁面?zhèn)鬟f過來的自定義參數(shù)
      params = router?.getParams();
      @State src: string = this.params == undefined ? '-' : (this.params as Record< string,Object >)['src'] as string;
      @State count: number = this.params == undefined ? 0 : (this.params as Record< string,Object >)['count'] as number;
    
      build() {
        Column() {
          Image($r('app.media.left'))
            ...
    
          Text($r('app.string.main_second_page_name'))
            ...
    
          // 用一個Text文本展示從Index頁面?zhèn)鬟f過來的數(shù)據(jù)      
          Text(`${this.src}${this.count}`)
            ...
    
          // 返回到EntryAbility的Index Page
          Button($r('app.string.back_main_index_page_btn_text'), { type: ButtonType.Capsule, stateEffect: true })
            ...
        }
        ...
      }
    }
    
  4. 從entry模塊的Second返回到Index頁面,使用router.back來實(shí)現(xiàn)。在EntryAbility的Second頁面中,點(diǎn)擊“返回到EntryAbility的Index Page”按鈕后,返回到EntryAbility的Index頁面,示例代碼如下:

    // 返回到EntryAbility的Index Page
    router.back();
    

跳轉(zhuǎn)到指定UIAbility的首頁

實(shí)現(xiàn)UIAbility間頁面的跳轉(zhuǎn),需要啟動另外一個UIAbility,可以通過UIAbilityContext的startAbility的方法來完成。本篇Codelab是用兩個模塊(entry和device),實(shí)現(xiàn)UIAbility間頁面的跳轉(zhuǎn)。跳轉(zhuǎn)到指定UIAbility的首頁,效果圖如下:

  1. 在本章節(jié)中,實(shí)現(xiàn)跳轉(zhuǎn)到指定UIAbility的首頁,我們需要新建一個模塊。在“Project”窗口,右鍵點(diǎn)擊“entry 文件夾”,選擇“New > Module > Empty Ability > Next”,在“Module name”中給新建的模塊命名為“device”,點(diǎn)擊“Next”,在“Ability name”中給新建模塊的Ability命名為“SecondAbility”,點(diǎn)擊“Finish”。可以看到文件目錄結(jié)構(gòu)如下:
  2. 構(gòu)建SecondAbility的首頁。在“Project”窗口,點(diǎn)擊“device > src > main > ets > pages”,打開“Index.ets”文件,可以看到SecondAbility的Index頁面由一個Image組件、兩個Text組件、一個Button組件組成。“Index.ets”文件的示例代碼如下:
    @Entry
    @Component
    struct Index {
      ...
    
      build() {
        Column() {
          Image($r('app.media.left'))
            ...
    
          Text($r('app.string.second_index_page_name'))
            ...
    
          Text(`${this.src}:${this.count}`)
            ...
    
          // 停止SecondAbility自身
          Button($r('app.string.terminate_second_btn_text'), { type: ButtonType.Capsule, stateEffect: true })
            ...
        }
        ...
      }
    }
    
  3. 從entry模塊的EntryAbility的首頁,跳轉(zhuǎn)到SecondAbility的首頁,即從EntryAbility的Index頁面跳轉(zhuǎn)到SecondAbility的Index頁面。通過UIAbilityContext的startAbility方法來實(shí)現(xiàn)。
    • 首先需要在EntryAbility的“Index.ets”文件中獲取UIAbilityContext,示例代碼如下:

      // 獲取UIAbilityContext
      let context = getContext(this) as common.UIAbilityContext;
      

      說明: 如果需要使用UIAbilityContext中的方法,需要在對應(yīng)的頁面獲取相應(yīng)的UIAbilityContext。

    • 在EntryAbility的Index頁面中,點(diǎn)擊“導(dǎo)航到SecondAbility的Index Page”按鈕后,調(diào)用ButtonClickMethod類中的toSecondAbilityIndex方法,拉起SecondAbility的Index頁面。使用UIAbilityContext.startAbility來實(shí)現(xiàn),可以通過parameters來向被拉起方傳遞參數(shù),示例代碼如下:

      // 導(dǎo)航到SecondAbility的Index Page
      toSecondAbilityIndex(context: common.UIAbilityContext) {
        let want: Want = {
          'deviceId': '',
          'bundleName': CommonConstants.BUNDLE_NAME,
          'abilityName': CommonConstants.SECOND_ABILITY_NAME,
          'moduleName': CommonConstants.DEVICE_MODULE_NAME,
          'parameters': {
             src: textMessage,
             count: CommonConstants.NUM_VALUES[1]
           }
        };
        context.startAbility(want).then(() = > {
          Logger.info(CommonConstants.TAG, `start second ability index page succeed with ${JSON.stringify(want)}`);
        }).catch((error: Error) = > {
          Logger.error(CommonConstants.TAG, `start second ability index page failedwith ${error}`);
        });
      }
      
    • 在SecondAbility的Index頁面,獲取從EntryAbility的Index頁面?zhèn)鬟f過來的自定義參數(shù),并用一個Text文本展示從Index頁面?zhèn)鬟f過來的數(shù)據(jù),示例代碼如下:

      @Entry
      @Component
      struct Index {
        // 獲取從EntryAbility的Index頁面?zhèn)鬟f過來的自定義參數(shù)
        secondAbilityWant?: Want = GlobalContext.getContext().getObject('secondAbilityWant');
        @State src: string = this.secondAbilityWant?.parameters?.src as string ?? '-';
        @State count: number = this.secondAbilityWant?.parameters?.count as number ?? 0;
      
        build() {
          Column() {
            Image($r('app.media.left'))
              ...
      
            Text($r('app.string.second_index_page_name'))
              ...
      
            // 用一個Text文本展示從Index頁面?zhèn)鬟f過來的數(shù)據(jù)
            Text(`${this.src}${this.count}`)
              ...
      
            // 停止SecondAbility自身
            Button($r('app.string.terminate_second_btn_text'), { type: ButtonType.Capsule, stateEffect: true })
              ...
          }
          ...
        }
      }
      
  4. 在SecondAbility的Index頁面,點(diǎn)擊“停止SecondAbility自身”按鈕,使用UIAbilityContext.terminateSelf方法手動銷毀Ability。示例代碼如下:
    // 停止SecondAbility自身
    terminateSecondAbility(context: common.UIAbilityContext) {
      context.terminateSelf().then(() = > {
        Logger.info(CommonConstants.TAG, 'terminate second ability self succeed');
      }).catch((error: Error) = > {
        Logger.error(CommonConstants.TAG, `terminate second ability self failed with ${error}`);
      });
    }
    
  5. 運(yùn)行時,需要在DevEco Studio的entry模塊中勾選“Deploy Multi Hap Packages”,如下圖所示:

跳轉(zhuǎn)到指定UIAbility的指定頁面(非首頁)

跳轉(zhuǎn)到指定UIAbility的指定頁面(非首頁),本章節(jié)以從EntryAbility的Index頁面跳轉(zhuǎn)到SecondAbility的Second頁面為例。只需要在本文檔“跳轉(zhuǎn)到指定UIAbility的首頁”章節(jié)的基礎(chǔ)上,另外在device模塊中構(gòu)建一個Second頁面。效果圖如下:

  1. 構(gòu)建SecondAbility的Second頁面。在“Project”窗口,打開“device > src > main > ets”,右鍵點(diǎn)擊“pages”文件夾,選擇“New > Page”,命名為“Second”。可以看到文件目錄結(jié)構(gòu)如下:
  2. 可以看到SecondAbility的Second頁面由一個Image組件、兩個Text組件、一個Button組件組成。“Second.ets”文件的示例代碼如下:
    @Entry
    @Component
    struct Second {
      // 用來接收parameters參數(shù)傳過來的值
      secondAbilityWant?: Want = GlobalContext.getContext().getObject('secondAbilityWant');
      @State src: string = this.secondAbilityWant?.parameters?.src as string ?? '-';
      @State count: number = this.secondAbilityWant?.parameters?.count as number ?? 0;
    
      build() {
        Column() {
          Image($r('app.media.left'))
            ...
    
          Text($r('app.string.second_second_page_name'))
            ...
    
          Text(`${this.src}${this.count}`)
            ...
    
          // 停止SecondAbility自身并返回結(jié)果
          Button($r('app.string.terminate_second_for_result_btn_text'), { type: ButtonType.Capsule, stateEffect: true })
            ...
        }
        ...
      }
    }
    
  3. 在EntryAbility的Index頁面中,點(diǎn)擊“導(dǎo)航到SecondAbility的Second Page”按鈕后,調(diào)用ButtonClickMethod類中的toSecondAbilitySecond方法,拉起SecondAbility的Second頁面。
    • 使用UIAbilityContext.startAbilityForResult來實(shí)現(xiàn),并獲取被拉起側(cè)銷毀后的返回結(jié)果。可以通過parameters來向被拉起方傳遞參數(shù),示例代碼如下:
      // 導(dǎo)航到SecondAbility的Second Page
      toSecondAbilitySecond(context: common.UIAbilityContext, callback: (abilityResult: common.AbilityResult) = > void) {
        let want: Want = {
          'deviceId': '',
          'bundleName': CommonConstants.BUNDLE_NAME,
          'abilityName': CommonConstants.SECOND_ABILITY_NAME,
          'moduleName': CommonConstants.DEVICE_MODULE_NAME,
          'parameters': {
             url: 'pages/Second',
             src: textMessage,
             count: CommonConstants.NUM_VALUES[2]
           }
        };
      
        // 被拉起側(cè)銷毀后,在startAbilityForResult回調(diào)中可以獲取到被拉起側(cè)銷毀時傳遞過來的AbilityResult
        context.startAbilityForResult(want).then((result) = > {
          callback(result);
          Logger.info(CommonConstants.TAG, `start second ability second page succeed with ${JSON.stringify(want)}`);
        }).catch((error: Error) = > {
          Logger.error(CommonConstants.TAG, `start second ability second page failed with ${error}`);
        });
      }
      
    • 在“Project”窗口,點(diǎn)擊“device > src > main > ets > SecondAbility”,打開“SecondAbility.ets”文件,在onWindowStageCreate的生命周期回調(diào)函數(shù)中獲取拉起方的意圖,展示SecondAbility的指定頁面到界面。示例代碼如下:
onWindowStageCreate(windowStage: Window.WindowStage) {
          ...
          let parameters: Record< string, Object > = (GlobalContext.getContext().getObject('secondAbilityWant') as Want)?.parameters as Record< string, Object >;
          let url = parameters?.url ?
            parameters.url as string : 'pages/Index';
          windowStage.loadContent(url, (err, data) = > {
            ...
          });
        }
`HarmonyOS與OpenHarmony鴻蒙文檔籽料:mau123789是v直接拿`

鴻蒙文檔.png

  1. 在SecondAbility的Second頁面,點(diǎn)擊“停止SecondAbility自身并返回結(jié)果”按鈕,使用UIAbilityContext.terminateSelfWithResult方法,傳入不同的resultCode和want,手動銷毀Ability。成功后發(fā)起拉起側(cè)會收到abilityResult的值。示例代碼如下:
    // 停止SecondAbility自身并返回結(jié)果
    terminateSecondAbilityForResult(context: common.UIAbilityContext) {
      let abilityResult: common.AbilityResult = {
        resultCode: CommonConstants.RESULT_CODE,
        want: {
          'deviceId': '',
          'bundleName': CommonConstants.BUNDLE_NAME,
          'abilityName': CommonConstants.SECOND_ABILITY_NAME,
          'moduleName': CommonConstants.DEVICE_MODULE_NAME,
          'parameters': {
             src: returnMessage,
             count: CommonConstants.RESULT_NUM_VALUE
           }
        }
      };
    
      // 停止SecondAbility自身,并將abilityResult返回給startAbilityForResult接口調(diào)用方
      context.terminateSelfWithResult(abilityResult).then(() = > {
        Logger.info(CommonConstants.TAG, `terminate second ability self with
          result succeed with ${JSON.stringify(abilityResult)}`);
      }).catch((error: Error) = > {
        Logger.error(CommonConstants.TAG, `terminate second ability self with
          result failed with ${error}`);
      });
    }
    

審核編輯 黃宇

聲明:本文內(nèi)容及配圖由入駐作者撰寫或者入駐合作網(wǎng)站授權(quán)轉(zhuǎn)載。文章觀點(diǎn)僅代表作者本人,不代表電子發(fā)燒友網(wǎng)立場。文章及其配圖僅供工程師學(xué)習(xí)之用,如有內(nèi)容侵權(quán)或者其他違規(guī)問題,請聯(lián)系本站處理。 舉報(bào)投訴
  • 框架
    +關(guān)注

    關(guān)注

    0

    文章

    404

    瀏覽量

    17704
  • 鴻蒙
    +關(guān)注

    關(guān)注

    57

    文章

    2464

    瀏覽量

    43582
收藏 人收藏

    評論

    相關(guān)推薦

    HarmonyOS開發(fā)案例:【UIAbility內(nèi)UIAbility頁面的跳轉(zhuǎn)

    基于Stage模型下的UIAbility開發(fā),實(shí)現(xiàn)UIAbility內(nèi)UIAbility頁面的
    的頭像 發(fā)表于 05-09 15:06 ?1910次閱讀
    HarmonyOS開發(fā)案例:【<b class='flag-5'>UIAbility</b><b class='flag-5'>內(nèi)</b>和<b class='flag-5'>UIAbility</b><b class='flag-5'>間</b><b class='flag-5'>頁面的</b><b class='flag-5'>跳轉(zhuǎn)</b>】

    鴻蒙Ability Kit程序框架服務(wù))【UIAbility組件生命周期】

    當(dāng)用戶打開、切換和返回到對應(yīng)應(yīng)用時,應(yīng)用中的UIAbility實(shí)例會在其生命周期的不同狀態(tài)之間轉(zhuǎn)換。UIAbility類提供了一系列回調(diào),通過這些回調(diào)可以知道當(dāng)前UIAbility實(shí)例的某個狀態(tài)發(fā)生改變,會經(jīng)過
    的頭像 發(fā)表于 05-30 21:51 ?1872次閱讀
    <b class='flag-5'>鴻蒙</b><b class='flag-5'>Ability</b> <b class='flag-5'>Kit</b>(<b class='flag-5'>程序</b><b class='flag-5'>框架</b><b class='flag-5'>服務(wù)</b>)【<b class='flag-5'>UIAbility</b>組件生命周期】

    鴻蒙Ability Kit程序框架服務(wù))【UIExtensionAbility】

    UIExtensionComponent嵌入提供方應(yīng)用的UIExtensionAbility提供的UI。UIExtensionAbility會在獨(dú)立于UIAbility的進(jìn)程中運(yùn)行,完成其頁面的布局和渲染。常用于有進(jìn)程隔離訴求的系統(tǒng)彈窗、狀態(tài)欄、膠囊等模塊化開發(fā)的場景。
    的頭像 發(fā)表于 06-05 09:19 ?1745次閱讀
    <b class='flag-5'>鴻蒙</b><b class='flag-5'>Ability</b> <b class='flag-5'>Kit</b>(<b class='flag-5'>程序</b><b class='flag-5'>框架</b><b class='flag-5'>服務(wù)</b>)【UIExtensionAbility】

    鴻蒙開發(fā)-應(yīng)用程序框架UIAbility的使用

    據(jù)傳遞、UIAbility的數(shù)據(jù)跳轉(zhuǎn)和數(shù)據(jù)傳遞,本章節(jié)主要講解UIAbility內(nèi)頁面的跳轉(zhuǎn)
    發(fā)表于 01-17 16:36

    ArkTS語言HarmonyOS/OpenHarmony應(yīng)用開發(fā)-router事件跳轉(zhuǎn)到指定UIAbility

    hilog.info(0x0000, \'testTag\', \'%{public}s\', \'Ability onBackground\'); } } *附件:ArkTS語言HarmonyOSOpenHarmony應(yīng)用開發(fā)-router事件跳轉(zhuǎn)到指定
    發(fā)表于 06-13 17:22

    鴻蒙開發(fā)丨設(shè)備內(nèi) UIAbility 的幾種交互方式

    UIAbility 組件交互(設(shè)備內(nèi)) 在設(shè)備內(nèi)UIAbility(用戶界面能力)是系統(tǒng)調(diào)度的最小單元,它們負(fù)責(zé)展示用戶界面和執(zhí)行相關(guān)的
    的頭像 發(fā)表于 02-02 10:42 ?826次閱讀
    <b class='flag-5'>鴻蒙</b>開發(fā)丨設(shè)備<b class='flag-5'>內(nèi)</b> <b class='flag-5'>UIAbility</b> 的幾種交互方式

    鴻蒙Ability Kit程序框架服務(wù))【UIAbility組件概述】

    UIAbility組件是一種包含UI的應(yīng)用組件,主要用于和用戶交互。
    的頭像 發(fā)表于 05-30 20:17 ?606次閱讀
    <b class='flag-5'>鴻蒙</b><b class='flag-5'>Ability</b> <b class='flag-5'>Kit</b>(<b class='flag-5'>程序</b><b class='flag-5'>框架</b><b class='flag-5'>服務(wù)</b>)【<b class='flag-5'>UIAbility</b>組件概述】

    鴻蒙Ability Kit程序框架服務(wù))【UIAbility組件生命周期】實(shí)例

    本文檔主要描述了應(yīng)用運(yùn)行過程中UIAbility和自定義組件的生命周期。對于UIAbility,描述了Create、Foreground、Background、Destroy四種生命周期。對于頁面
    的頭像 發(fā)表于 05-31 15:03 ?1370次閱讀
    <b class='flag-5'>鴻蒙</b><b class='flag-5'>Ability</b> <b class='flag-5'>Kit</b>(<b class='flag-5'>程序</b><b class='flag-5'>框架</b><b class='flag-5'>服務(wù)</b>)【<b class='flag-5'>UIAbility</b>組件生命周期】實(shí)例

    鴻蒙Ability Kit程序框架服務(wù))【UIAbility組件啟動模式】

    UIAbility的啟動模式是指UIAbility實(shí)例在啟動時的不同呈現(xiàn)狀態(tài)。針對不同的業(yè)務(wù)場景,系統(tǒng)提供了三種啟動模式:
    的頭像 發(fā)表于 06-06 11:05 ?1089次閱讀
    <b class='flag-5'>鴻蒙</b><b class='flag-5'>Ability</b> <b class='flag-5'>Kit</b>(<b class='flag-5'>程序</b><b class='flag-5'>框架</b><b class='flag-5'>服務(wù)</b>)【<b class='flag-5'>UIAbility</b>組件啟動模式】

    鴻蒙Ability Kit程序框架服務(wù))【UIAbility組件基本用法】

    UIAbility組件的基本用法包括:指定UIAbility的啟動頁面以及獲取UIAbility的上下文[UIAbilityContext]。
    的頭像 發(fā)表于 06-06 11:02 ?728次閱讀
    <b class='flag-5'>鴻蒙</b><b class='flag-5'>Ability</b> <b class='flag-5'>Kit</b>(<b class='flag-5'>程序</b><b class='flag-5'>框架</b><b class='flag-5'>服務(wù)</b>)【<b class='flag-5'>UIAbility</b>組件基本用法】

    鴻蒙Ability Kit程序框架服務(wù))【UIAbility組件與UI的數(shù)據(jù)同步】

    基于當(dāng)前的應(yīng)用模型,可以通過以下幾種方式來實(shí)現(xiàn)UIAbility組件與UI之間的數(shù)據(jù)同步。
    的頭像 發(fā)表于 06-03 10:26 ?699次閱讀
    <b class='flag-5'>鴻蒙</b><b class='flag-5'>Ability</b> <b class='flag-5'>Kit</b>(<b class='flag-5'>程序</b><b class='flag-5'>框架</b><b class='flag-5'>服務(wù)</b>)【<b class='flag-5'>UIAbility</b>組件與UI的數(shù)據(jù)同步】

    鴻蒙Ability Kit程序框架服務(wù))【UIAbility組件交互(設(shè)備內(nèi))】

    UIAbility是系統(tǒng)調(diào)度的最小單元。在設(shè)備內(nèi)的功能模塊之間跳轉(zhuǎn)時,會涉及到啟動特定的UIAbility,該UIAbility可以是應(yīng)用
    的頭像 發(fā)表于 06-03 09:53 ?882次閱讀
    <b class='flag-5'>鴻蒙</b><b class='flag-5'>Ability</b> <b class='flag-5'>Kit</b>(<b class='flag-5'>程序</b><b class='flag-5'>框架</b><b class='flag-5'>服務(wù)</b>)【<b class='flag-5'>UIAbility</b>組件<b class='flag-5'>間</b>交互(設(shè)備<b class='flag-5'>內(nèi)</b>)】

    鴻蒙Ability Kit程序框架服務(wù))【Ability內(nèi)頁面跳轉(zhuǎn)

    基于Stage模型下的Ability開發(fā),實(shí)現(xiàn)Ability內(nèi)頁面跳轉(zhuǎn)和數(shù)據(jù)傳遞。
    的頭像 發(fā)表于 06-03 20:43 ?453次閱讀
    <b class='flag-5'>鴻蒙</b><b class='flag-5'>Ability</b> <b class='flag-5'>Kit</b>(<b class='flag-5'>程序</b><b class='flag-5'>框架</b><b class='flag-5'>服務(wù)</b>)【<b class='flag-5'>Ability</b>內(nèi)<b class='flag-5'>頁面</b><b class='flag-5'>間</b>的<b class='flag-5'>跳轉(zhuǎn)</b>】

    鴻蒙開發(fā)Ability Kit程序框架服務(wù):任務(wù)管理

    AbilityRecord:系統(tǒng)服務(wù)側(cè)管理一個UIAbility實(shí)例的最小單元,對應(yīng)一個應(yīng)用側(cè)的UIAbility組件實(shí)例。系統(tǒng)服務(wù)側(cè)管理UIAbi
    的頭像 發(fā)表于 06-24 14:46 ?625次閱讀
    <b class='flag-5'>鴻蒙</b>開發(fā)<b class='flag-5'>Ability</b> <b class='flag-5'>Kit</b><b class='flag-5'>程序</b><b class='flag-5'>框架</b><b class='flag-5'>服務(wù)</b>:任務(wù)管理

    鴻蒙開發(fā)Ability Kit程序框架服務(wù):FA模型啟動Stage模型UIAbility

    本文介紹FA模型的三種應(yīng)用組件如何啟動Stage模型的UIAbility組件。
    的頭像 發(fā)表于 06-25 16:00 ?524次閱讀
    <b class='flag-5'>鴻蒙</b>開發(fā)<b class='flag-5'>Ability</b> <b class='flag-5'>Kit</b><b class='flag-5'>程序</b><b class='flag-5'>框架</b><b class='flag-5'>服務(wù)</b>:FA模型啟動Stage模型<b class='flag-5'>UIAbility</b>
    主站蜘蛛池模板: 亚洲人成网站在线观看妞妞网 | 国产精品成人四虎免费视频 | 欧美经典三级春潮烂漫海棠红 | 九九精品国产 | 美女扒开尿口给男人桶爽视频 | 国产免费人人看大香伊 | 91精品日本久久久久久牛牛 | 在线免费视频一区二区 | 丁香花在线视频 | 午夜在线视频国产 | 激情婷婷六月天 | 视频在线一区二区 | 手机看片福利盒子久久青 | 欧美一区二区三区免费 | 久久精品大全 | 小说老卫陈红张敏陈法蓉 | 一卡二卡四卡无卡乱免费网页 | 91网站网站网站在线 | 成人欧美一区二区三区小说 | 激情五月亚洲 | 午夜神马福利免费官方 | 日日干夜夜操 | 国产美女精品久久久久久久免费 | 视频免费1区二区三区 | 综合第一页| 国内在线观看精品免费视频 | 黄色网址视频在线播放 | 天天视频色版 | 久久狠狠干 | 久久婷婷色 | 国产精品久久久久天天影视 | 都市激情亚洲 | 免费一级毛片女人图片 | 在线观看亚洲一区二区 | 国产男女免费视频 | 亚洲 欧美 91 | cao草棚视频网址成人 | 久久久五月天 | 四虎国产永久在线观看 | www欧美在线观看 | 性欧美激情在线观看 |