目录

How do I obtain resources in the resources directory?

To obtain resources in the resources directory, try either of the following ways:

1. Use $r or $rawfile to obtain static resources. The resource path does not change during program running.

2. Use ResourceManager to obtain resources. This method applies to dynamic access, during which the file path in the resources directory dynamically changes during program running.

Reference

Accessing Resources

@ohos.resourceManager (Resource Management)