它我的理解是UIAutomator无法自动那里NAF在uiautomatorviewer =真任何元素。香港专业教育学院搜查高和低,但我不能为我的生活中找到什么NAF代表。有人知道吗?
“不友善无障碍”
这些都是显然是互动的,但它不具有可访问性启示像内容描述UI元素。
从源AccessibilityNodeInfoDumper.java(uiautomator的一部分):
/** * We're looking for UI controls that are enabled, clickable but have no * text nor content-description. Such controls configuration indicate an * interactive control is present in the UI and is most likely not * accessibility friendly. We refer to such controls here as NAF controls * (Not Accessibility Friendly) * * @param node * @return false if a node fails the check, true if all is OK */ private static boolean nafCheck(AccessibilityNodeInfo node) { boolean isNaf = node.isClickable() && node.isEnabled() && safeCharSeqToString(node.getContentDescription()).isEmpty() && safeCharSeqToString(node.getText()).isEmpty(); if (!isNaf) return true; // check children since sometimes the containing element is clickable // and NAF but a child's text or description is available. Will assume // such layout as fine. return childNafCheck(node); }
NAF表示“不友善无障碍”。