私はiOSの新機能です。ボイスオーバー機能を含むアプリを作っています。私のアプリはコレクションビューからなっています。アプリケーションにはチェックボックスがあり(ボタンなしの画像は表示されません)、チェックされている/表示されていないステータスが表示されます。
チェックボックスをオンにしてから、これを読み上げるときにボイスオーバーしました。 - > [self.checkBoxImageView setAccessibilityHint:@ "~~~~"];
最初に試したときに正しい操作(ボイスオーバー)があったが、もう一度のボイスオーバーで読み返した後にになった。
操作したいコードを修正するにはどうすればよいですか?
下に自分のコードを添付してください。
最初の機能=========================================================================================================================================== ====遅延フォーカス状態になるボイスオーバーAPIはありますか?
- (void)setChecked:(BOOL)checked {
NSLog(@"%s, checked = %d", __func__, _checked);
NSLog(@"[D] checked : %d", checked);
// Save property value
_checked = checked;
// Update checkbox image
NSString * filename;
if(checked)
{
filename = [[NSBundle bundleForClass:[self class]] pathForResource:@"check_on" ofType:@"png"];
[self.checkBoxImageView setAccessibilityHint:@"Checked"];
}
else
{
filename = [[NSBundle bundleForClass:[self class]] pathForResource:@"check_off" ofType:@"png"];
[self.checkBoxImageView setAccessibilityHint:@"Unchecked"];
}
[self.checkBoxImageView setImage:[UIImage imageWithContentsOfFile:filename]];
NSLog(@"[D] self.checkBoxImageView setImage:[UIImage");
self.checkBoxImageView.frame = CGRectMake(12, 12, 50/2, 50/2);
NSLog(@"[D] self.checkBoxImageView.frame = CGRectMake");
}
=========================別の関数============ =============
- (void) collectionView:(UICollectionView *)cv didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
NSLog(@"%s", __func__);
NSLog(@"%@", indexPath.description);
//[collectionView deselectItemAtIndexPath:indexPath animated:YES];
//// Get selected cell
//MYCell* cell = (MYCell*) [collectionView cellForItemAtIndexPath:indexPath];
[cv deselectItemAtIndexPath:indexPath animated:NO];
// Get selected cell
MYCell* cell = (MYCell*) [cv cellForItemAtIndexPath:indexPath];
// if (cell.checked == NO)
// cell.checked = YES;
// else if (cell.checked == YES)
// cell.checked = NO;
// Check if set contains selected cell indexPath
if([self.checkedIndexPaths member:indexPath])
{
// User tapped on checked cell
// Remove selected indexPath from set
[self.checkedIndexPaths removeObject:indexPath];
// Uncheck checkbox on cell
cell.checked = NO;
}
else // User tapped on unchecked cell
{
// Add selected indexPath to set
[self.checkedIndexPaths addObject:indexPath];
// Check checkbox on cell
cell.checked = YES;
}
}
チェックボックスにチェックを入れずにフォーカスを合わせ、チェックボックスをオンにして、操作を修正する必要がある場合は、 –