在Xamarin表单中,如果你激活导航栏,显示页面的标题和一个箭头作为后退按钮,当你激活屏幕阅读器,后退按钮是焦点,对讲(Android)说“unlabeled button”.我知道如何设置通用元素的可访问性名称,但我不知道如何获得后退按钮元素,因为它不是一个示例.
relj7zay1#
如果使用 shell 导航,请创建CustomShellRenderer
[assembly: ExportRenderer(typeof(AppShell), typeof(CustomShellRenderer))] namespace Droid.Renderers.CustomAppShell { public class CustomShellRenderer : ShellRenderer { protected override IShellToolbarAppearanceTracker CustomToolbarAppearanceTracker() { return new CustomShellToolbarAppearanceTracker(this); } } } namespace Droid.CustomShell { public class CustomShellToolbarAppearanceTracker : ShellToolbarAppearanceTracker { public override void SetAppearance(AndroidX.AppCompat.Widget.Toolbar toolbar, IShellToolbarTracker toolbarTracker, ShellAppearance appearance) { base.SetAppearance(toolbar, toolbarTracker, appearance); toolbar.NavigationContentDescription = "Custom Label Description”; // Set label here } } }
1条答案
按热度按时间relj7zay1#
如果使用 shell 导航,请创建CustomShellRenderer