使用Android辅助功能从imageview获取图像

时间:2018-06-27 20:08:28

标签: android image imageview accessibility accessibilityservice

是否可以使用Android辅助功能从imageviews获取图像?我从edittext和textview获取文本,但无法从imageviews获取图像。在使用Log.d("IMAGE",root.toString());打印AccessibilityNodeInfo(命名为root)时,我得到了:

   D/IMAGE: android.view.accessibility.AccessibilityNodeInfo@8001bc92; 
boundsInParent: Rect(0, 0 - 102, 96); 
boundsInScreen: Rect(933, 0 - 1035, -210); 
packageName: com.android.systemui; 
className: android.widget.ImageView; 
text: null; 
error: null; 
maxTextLength: -1; 
contentDescription: Brightness settings panel; 
viewIdResName: null; 
checkable: false; 
checked: false; 
focusable: true; 
focused: false; 
selected: false; 
clickable: true; 
longClickable: false; 
contextClickable: false; 
enabled: true; 
password: false; 
scrollable: false; 
actions: [AccessibilityAction: ACTION_FOCUS - null, AccessibilityAction: ACTION_SELECT - null, AccessibilityAction: ACTION_CLEAR_SELECTION - null, AccessibilityAction: ACTION_CLICK - null, AccessibilityAction: ACTION_ACCESSIBILITY_FOCUS - null, AccessibilityAction: ACTION_NEXT_AT_MOVEMENT_GRANULARITY - null, AccessibilityAction: ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY - null, AccessibilityAction: ACTION_SET_SELECTION - null, AccessibilityAction: ACTION_SHOW_ON_SCREEN - null]

1 个答案:

答案 0 :(得分:0)

您可以将内容描述设置为imageview

android:contentDescription="imagename"