解决措施$r当前不支持嵌套,第二个参数需要使用ResourceManager获取应用资源对应字符串赋值给$r第二个参数。代码示例import { common } from '@kit.AbilityKit'; @Entry @Component struct Page16 { private context: common.UIAbilityContext = getContext(this) as common.UIAbilityContext; build() { Row() { Column() { Text($r('app.string.EntryAbility1_label2', this.context.resourceManager.getStringSync($r('app.string.EntryAbility_label'))))//resources\base\element\string.json .fontSize(50) .fontWeight(FontWeight.Bold) } .width('100%') } .height('100%') } }参考链接ResourceManager
解决措施
$r当前不支持嵌套,第二个参数需要使用ResourceManager获取应用资源对应字符串赋值给$r第二个参数。
代码示例
参考链接
ResourceManager