<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                [TOC] ## 概述 - 應用開發過程中,經常需要用到顏色、字體、間距、圖片等資源,在不同的設備或配置中,這些資源的值可能不同。 - resources目錄包括三大類目錄,一類為base目錄,一類為限定詞目錄,還有一類為rawfile目錄 - 可通過 `DevEco Studio` 新建資源目錄或資源文件 **樣式:** ``` resources |---base | |---element | | |---string.json | |---media | | |---icon.png | |---profile | | |---test_profile.json |---en_US // 默認存在的目錄,設備語言環境是美式英文時,優先匹配此目錄下資源 | |---element | | |---string.json | |---media | | |---icon.png | |---profile | | |---test_profile.json |---zh_CN // 默認存在的目錄,設備語言環境是簡體中文時,優先匹配此目錄下資源 | | ... |---rawfile // 其他類型文件,原始文件形式保存,不會被集成到resources.index文件中。文件名可自定義。 ``` **限定詞目錄** * 限定詞的組合順序:\_移動國家碼\_移動網絡碼-語言\_文字\_國家或地區-橫豎屏-設備類型-顏色模式-屏幕密度\_。開發者可以根據應用的使用場景和設備特征,選擇其中的一類或幾類限定詞組成目錄名稱。 * 限定詞的連接方式:語言、文字、國家或地區之間采用下劃線(\_)連接,移動國家碼和移動網絡碼之間也采用下劃線(\_)連接,除此之外的其他限定詞之間均采用中劃線(-)連接。例如:**zh\_Hant\_CN**、**zh\_CN-car-ldpi**。 * 限定詞的取值范圍:每類限定詞的取值必須符合限定詞取值要求表中的條件,否則,將無法匹配目錄中的資源文件。 具體說明請查看文檔:https://developer.harmonyos.com/cn/docs/documentation/doc-guides-V3/resource-categories-and-access-0000001544463977-V3 ## 目錄詳情 ### element ``` element目錄中的文件名稱建議與下面的文件名保持一致。每個文件中只能包含同一類型的數據。 - boolean.json - color.json - float.json - intarray.json - integer.json - pattern.json - plural.json - strarray.json - string.json ``` ### media 表示媒體資源,包括圖片、音頻、視頻等非文本格式的文件(目錄下只支持文件類型) 文件名可自定義,例如:icon.png。 圖片資源 ``` .jpg .png .gif .svg .webp .bmp ``` 視頻資源 ``` .mp4 .webm .mkv ``` ### profile 表示自定義配置文件,其文件內容可通過包管理接口獲取(目錄下只支持文件類型)。 文件名可自定義,例如:test_profile.json。 ### 使用資源 ``` Text($r('app.string.string_hello')) // 引用string.json資源。Text中$r的第一個參數指定string資源,第二個參數用于替換string.json文件中的%s。 Text($r('app.string.message_arrive', "five of the clock")) // 應用資源 Image($rawfile('test.png')) // rawfile$r引用rawfile目錄下圖片 ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看