harmony 鸿蒙Intl Development

  • 2022-12-22
  • 浏览 (644)

Intl Development

How resources in AppScope, such as images and text, are referenced?

Applicable to: OpenHarmony SDK 3.2.5.5, stage model of API version 9

Resources are referenced in the $r(‘app.type.name’) format. Where, type indicates the resource type, such as color, string, and media, and name indicates the resource name.

How do I convert the resource type to string?

Applicable to: OpenHarmony SDK3.0, stage model of API version 9

If the resource type is set to string, the qualifier directory can be set as this.context.resourceManager.getStringSync(\$r(‘app.string.test’).id) and can be converted synchronously. The \$r(‘app.string.test’, 2) mode is not supported. For more usage methods, see Resource Manager.

Why should I do if the constants referenced by $ in the form_config.json file does not take effect?

Applicable to: OpenHarmony SDK 3.2.6.5, API9 Stage model

In the form_config.json file, $ cannot be used to reference constants.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙FAQs

harmony 鸿蒙Ability Framework Development

harmony 鸿蒙Bundle Management Development

harmony 鸿蒙Network and Connection Development

harmony 鸿蒙Data Management Development

harmony 鸿蒙Development Board Usage

harmony 鸿蒙Device Management Development

harmony 鸿蒙DFX Development

harmony 鸿蒙Common Event and Notification Development

harmony 鸿蒙File Management Development

0  赞