I'm working on the accessibility of a calendar which is actually a collectionView. Whenever a cell is tapped, the collectionView will be reloaded by calling
[self.collectionView reloadData];
The problem is if the voiceOver is running, the focus will move to another place after the cell tapped because that cell is reused on somewhere else.
Is there anyway to keep the focus where it was after the reloadData? Thanks!
Just find a workaround for this. The focus is changed because the focused cell is reused somewhere else when doing [colleciontView reloadData].
So if we reload the collectionViewCells one by one, that focused cell will not be used anywhere else. I call this method to reload the collectionView when VoiceOver is running.
- (void)reloadCalendarCollectionView {
NSInteger items = [self.calendarItems count];
for (NSInteger i = 0; i < items; i++) {
[self.collectionView reloadItemsAtIndexPaths:@[[NSIndexPath indexPathForItem:i inSection:1] ]];
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With