Setting UITabBarItem's accessibility label doesn't stick
| Originator: | firestone | ||
| Number: | rdar://9790189 | Date Originated: | 07/17/2011 |
| Status: | Open | Resolved: | |
| Product: | Accessibility | Product Version: | 4.3/5.0 |
| Classification: | UI/Usability | Reproducible: | Always |
* Summary:
The accessibility label for UITabBarItems can't be customized. You can set it, and it will read back correctly, but it quickly gets reset back to nil.
* Steps to Reproduce:
Start a sample project with a tab bar.
Add the following method to the app delegate:
- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController
{
// Attempt 1
UITabBarItem *item = [[self.tabBarController.tabBar items] lastObject];
item.accessibilityLabel = @"Custom Label";
// Attempt 2
UIView *tabBarButton = [[self.tabBarController.tabBar subviews] lastObject];
self.tabBarController.tabBarItem.accessibilityLabel = @"Custom Label";
// Attempt 3
tabBarButton.accessibilityLabel = @"Custom Label";
}
Switch back and forth between tabs.
Use the accessibility inspector to inspect the tab bar item labels and note that they're reset to "First" and "Second" (the item titles).
* Expected Results:
Expected that the accessibility label for at least one of the tab bar items would be "Custom label."
* Actual Results:
The tab bar items all have their accessibility label set to the same thing as their title.
* Regression:
Doesn't work on 4.3 or 5.0b2. Not sure about earlier versions.
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!