Xcode UI Tests can't find views that are added programmatically

前端 未结 2 1830
悲&欢浪女
悲&欢浪女 2020-12-11 20:25

I\'m adding a child view to my view programmatically, and when I do I attach all accessibility params to it:

  [labelView setAccessibilityLabel:@\"label\"];
         


        
2条回答
  •  猫巷女王i
    2020-12-11 21:09

    You need to make sure that the container view of your label view (UIEditText?) doesn't have isAccessibilityElement set to YES. If it does it will hide the accessibility of its subviews (your label).

    Check Make the Contents of Custom Container Views Accessible in the Accessibility Programming Guide

提交回复
热议问题