Setting accessibility identifier programmatically on UIBarButtonItem

后端 未结 4 1891
轻奢々
轻奢々 2021-02-12 08:26

The accessibility identifier is a developer generated ID for GUI objects, which can be used for automation tests.

A UIBarButtonItem does not implement

4条回答
  •  别跟我提以往
    2021-02-12 08:31

    As of iOS 5 you can do it like this:

    UIBarButtonItem *btn = [[UIBarButtonItem alloc] init...;
    btn.accessibilityLabel = @"Label";
    

提交回复
热议问题