다음을 통해 공유


View.AccessibilityLiveRegion Property

Definition

Gets the live region mode for this View. -or- Sets the live region mode for this view.

public virtual Android.Views.AccessibilityLiveRegion AccessibilityLiveRegion { [Android.Runtime.Register("getAccessibilityLiveRegion", "()I", "GetGetAccessibilityLiveRegionHandler")] get; [Android.Runtime.Register("setAccessibilityLiveRegion", "(I)V", "GetSetAccessibilityLiveRegion_IHandler")] set; }
[<get: Android.Runtime.Register("getAccessibilityLiveRegion", "()I", "GetGetAccessibilityLiveRegionHandler")>]
[<set: Android.Runtime.Register("setAccessibilityLiveRegion", "(I)V", "GetSetAccessibilityLiveRegion_IHandler")>]
member this.AccessibilityLiveRegion : Android.Views.AccessibilityLiveRegion with get, set

Property Value

The live region mode for the view.

Attributes

Remarks

Property getter documentation:

Gets the live region mode for this View.

Java documentation for android.view.View.getAccessibilityLiveRegion().

Property setter documentation:

Sets the live region mode for this view. This indicates to accessibility services whether they should automatically notify the user about changes to the view's content description or text, or to the content descriptions or text of the view's children (where applicable).

Different priority levels are available: <ul> <li> #ACCESSIBILITY_LIVE_REGION_POLITE: Indicates that updates to the region should be presented to the user. Suitable in most cases for prominent updates within app content that don't require the user's immediate attention. </li> <li> #ACCESSIBILITY_LIVE_REGION_ASSERTIVE: Indicates that updates to the region have the highest priority and should be presented to the user immediately. This may result in disruptive notifications from an accessibility service, which may potentially interrupt other feedback or user actions, so it should generally be used only for critical, time-sensitive information. </li> <li> #ACCESSIBILITY_LIVE_REGION_NONE: Disables change announcements (the default for most views). </li> </ul>

Examples: <ul> <li> Selecting an option in a dropdown menu updates a panel below with the updated content. This panel may be marked as a live region with #ACCESSIBILITY_LIVE_REGION_POLITE to notify users of the change. A screen reader may queue changes as announcements that don't disrupt ongoing speech. </li> <li> An emergency alert may be marked with #ACCESSIBILITY_LIVE_REGION_ASSERTIVE to immediately inform users of the emergency. </li> </ul>

For error notifications, like an "incorrect password" warning in a login screen, views should send a AccessibilityEvent#TYPE_WINDOW_CONTENT_CHANGEDAccessibilityEvent with a content change type AccessibilityEvent#CONTENT_CHANGE_TYPE_ERROR and set AccessibilityNodeInfo#setError(CharSequence). Custom widgets should provide error-setting methods that support accessibility. For example, use android.widget.TextView#setError(CharSequence) instead of explicitly sending events.

Don't use live regions for frequently-updating UI elements (e.g., progress bars), as this can overwhelm the user with feedback from accessibility services. If necessary, use AccessibilityNodeInfo#setMinDurationBetweenContentChanges(Duration) to throttle feedback and reduce disruptions.

<aside><b>Note:</b> Use androidx.core.view.ViewCompat#setAccessibilityLiveRegion(View, int) for backwards-compatibility. </aside>

Java documentation for android.view.View.setAccessibilityLiveRegion(int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

See also