简体   繁体   English

Android 辅助功能,如何删除所有按钮操作?

[英]Android Accessibility, how to remove all Button Actions?

On Android, TalkBack announces "Double tap to activate, double tap and hold to long press".在 Android 上,TalkBack 提示“双击激活,双击并按住以长按”。 How can I remove all these default actions and just have it say nothing?如何删除所有这些默认操作而让它什么都不说?

While ignoring whether that is a good idea or not for now.虽然暂时忽略这是否是一个好主意。

Update the below code seems to not do anything:更新下面的代码似乎没有做任何事情:

    private class NoActionsAccessibilityDelegate : View.AccessibilityDelegate
    {
        public override void OnInitializeAccessibilityNodeInfo(View host, Android.Views.Accessibility.AccessibilityNodeInfo info)
        {
            base.OnInitializeAccessibilityNodeInfo(host, info);
            foreach (var action in info.ActionList.ToList()) //to list ensures we are not iterating while modifying the readonly ActionList property
            {
                info.RemoveAction(action);
            }
        }
    }

If your 'view' does not have a click action but for some reason the system detects it as clickable, use the following, (I am using Xamarin for my implementation and the code to disable actions is as follows):如果您的“视图”没有点击操作,但由于某种原因系统将其检测为可点击,请使用以下命令,(我使用 Xamarin 来实现,禁用操作的代码如下):

myView.Clickable = false;
myView.LongClickable = false;

Yes that will disable interaction with the view, but in my case the view is not meant to be interactable to begin with.是的,这将禁用与视图的交互,但在我的情况下,视图并不意味着可以交互。 For some reason the system thinks it has an action though it does not.由于某种原因,系统认为它有一个动作,尽管它没有。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM