diff --git a/packages/core/ui/text-base/index.android.ts b/packages/core/ui/text-base/index.android.ts index 83e056498..77e935e10 100644 --- a/packages/core/ui/text-base/index.android.ts +++ b/packages/core/ui/text-base/index.android.ts @@ -13,6 +13,8 @@ import { Span } from './span'; import { CoreTypes } from '../../core-types'; import { layout } from '../../utils'; import { isString, isNullOrUndefined } from '../../utils/types'; +import { accessibilityIdentifierProperty } from '../../accessibility/accessibility-properties'; +import * as Utils from '../../utils'; export * from './text-base-common'; @@ -278,6 +280,15 @@ export class TextBase extends TextBaseCommon { this.nativeTextViewProtected.setTransformationMethod(new TextTransformation(this)); } + [accessibilityIdentifierProperty.setNative](value: string): void { + const id = Utils.ad.resources.getId(':id/nativescript_accessibility_id'); + + if (id) { + this.nativeViewProtected.setTag(id, value); + this.nativeViewProtected.setTag(value); + } + } + [textAlignmentProperty.getDefault](): CoreTypes.TextAlignmentType { return 'initial'; }