jjzjj

accessibilityIdentifier

全部标签

ios - 将 accessibilityIdentifier 添加到 UITabBarButton

我在我的应用程序中显示一个UITabBar,并尝试将accessibilityIdentifier分配给按钮。为此,我在每个ViewController实例化中使用了以下几行:viewController.tabBarItem.accessibilityIdentifier=@"ViewControllerID";这些viewControllers都被添加到UITabBar中,如下所示:NSMutableArray*tabBarItems=[NSMutableArrayarray];for(NSIntegeri=0;i所以,我认为这里应该发生的事情是,我们正在获取正确设置了access

swift - 为 GMSMarker 设置自定义 accessibilityIdentifier

我将GoogleMapsApi用于map和标记。我通过设置启用标记的可访问性:mapView.accessibilityElementsHidden=false现在我在map上的所有自定义标记都具有辅助功能ID,例如:myappname.GMSPlaceMarker_somenumbers,例如myappname.GMSPlaceMarker_0x600000170200。我如何为所有图钉设置一个accessibilityIdentifier,例如map图钉?我已经试过了:marker.accessibilityLabel="Mappin"但它设置的是label值,而不是idmarke

ios - Swift:UIBarButtonItem 以编程方式设置可访问性标识符

我正在尝试设置辅助功能标识符。我查看了这个示例:myBarButton.accessibilityIdentifier=@"Iamatestbutton!";但我没有在swift中获取accessibilityIdentifier。你们中有人知道如何在swift中设置accessibilityIdentifier吗? 最佳答案 UIBarButtonItem未实现UIAccessibilityIdentification,因此设置accessibilityIdentifier不起作用。改为尝试myBarButton.accessib

ios - UI 测试 : How to find UIBarButtonItem by accessibilityIdentifier with predicate?

这是我在代码中设置的方式:letuserBarButtonItem=UIBarButtonItem(image:userIcon,style:.Plain,target:self,action:Selector("userButtonTapped:"))userBarButtonItem.accessibilityIdentifier="userBarButtonItem"然后在UITestCase中,我需要使用以下方法找到它:XCUIApplication().otherElements["userBarButtonItem"]//doesntwork,andthereasonis:

ios - 我可以在界面生成器中设置可访问性标识符吗? Xcode4.2

我只能在界面生成器中设置辅助功能标签,但在UI自动化中,我需要辅助功能标识符来获取UI元素。有什么办法吗? 最佳答案 accessibilityIndentifier可以在IB中使用身份检查器选项卡的“用户定义的运行时属性”进行设置:关键路径:accessibilityIdentifier类型:字符串值:选择的可访问性标识rune本例如将ScrollView设置为具有可访问性ID“ScrollView”:注意:这只能用于具有accessibilityIdentifier属性的项目,这意味着它们从UIView继承。此外,“KeyPat

ios - 我可以在界面生成器中设置可访问性标识符吗? Xcode4.2

我只能在界面生成器中设置辅助功能标签,但在UI自动化中,我需要辅助功能标识符来获取UI元素。有什么办法吗? 最佳答案 accessibilityIndentifier可以在IB中使用身份检查器选项卡的“用户定义的运行时属性”进行设置:关键路径:accessibilityIdentifier类型:字符串值:选择的可访问性标识rune本例如将ScrollView设置为具有可访问性ID“ScrollView”:注意:这只能用于具有accessibilityIdentifier属性的项目,这意味着它们从UIView继承。此外,“KeyPat

ios - 如果我在同一元素上使用 accessibilityIdentifier 和 accessibilityLabel 会发生什么

如果我在同一元素上使用accessibilityIdentifier和accessibilityLabel会怎样?一个会覆盖另一个吗?残障用户仍然可以访问它吗? 最佳答案 辅助功能标识符仅用于自动化测试。它们对用户/开发人员没有帮助。您可以使用辅助功能标签/提示。即使您同时设置了它们,它们也不会被覆盖。 关于ios-如果我在同一元素上使用accessibilityIdentifier和accessibilityLabel会发生什么,我们在StackOverflow上找到一个类似的问题:

ios - 如何在 UITests 目标中使用 accessibilityIdentifier 查找 UIView

我试图在测试目标中找到一个带有navigationBaraccessibilityIdentifier的UIView元素,以检查isEnabled状态。尝试了不同的解决方案,但找不到所需的解决方案。有什么办法可以实现吗?尝试了这个解决方案:application.groups.matching(identifier:"navigationBar")-不起作用。 最佳答案 可以使用otherElements查询常规View。letapp=XCUIApplication()app.otherElements["navigationBar

ios - accessibilityIdentifier nil 在 xib 中设置时,必须从用户定义的运行时属性中设置

当我在InterfaceBuilder的Accessibility->Enabled->Identifier部分设置accessibilityIdentifier时,关联View的.accessibilityIdentifier属性是nil在运行时。但是,当我通过UserDefinedRuntimeAttributes设置它时,它工作正常。“用户定义的运行时属性”是一种变通方法,但我觉得向Android开发人员解释它是一个令人困惑的“古老secret”。“哦,那个字段不起作用,你必须把它设置在那里,在一个没有说明我们实际设置的东西的地方”还有其他人看到了吗?这是Xcode7的新功能吗?

ios - 无法设置 UISegmentedControl 的段的 accessibilityIdentifier

我发现,即使我可以设置UISegmentedControl的段的accessibilityLabel(参见:HowdoIsettheaccesibilitylabelforaparticularsegmentofaUISegmentedControl?),我也无法设置accessibilityIdentifier,这对我的项目同样重要。出于自动化目的,我需要定位一个段而不考虑其文本和accessibilityLabel。例如代码:NSString*name=[NSStringstringWithFormat:@"Item%li",(long)idx];segment.accessibi
12