如何在MKMapView中禁用MKAnnotationView和Street的辅助功能

时间:2015-09-30 09:36:22

标签: ios accessibility

我想在地图视图中禁用某些引脚。以某种方式设置MKAnnotationView无法MKAnnotationView

此外,我发现VoiceOver会在地图视图中从一个街道到另一个街道进行迭代,这在某些情况下可能没有意义。

那么还有其他方法可以禁用- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id<MKAnnotation>)annotation { if ([annotation isKindOfClass:[MKUserLocation class]]) return nil; ...//some setup MKAnnotationView *annotationView = [mapView dequeueReusableAnnotationViewWithIdentifier:annotationIdentifier]; if (!annotationView && ![annotationIdentifier isEqualToString:@""]) { annotationView = [[MKAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:annotationIdentifier]; } .../some config // somehow no effect :( annotationView.isAccessibilityElement = NO; return annotationView; 上的辅助功能以及地图中的街道吗?

当前代码

NSString *userJid = [NSString stringWithFormat:@"%@%@",cell.frndName.text,DomainName];
        NSString *userJid1= [NSString stringWithFormat:@"%@%@",[[NSUserDefaults standardUserDefaults]valueForKey:@"name"],DomainName];

        NSFetchRequest *messagesCoreD = [[NSFetchRequest alloc] init];
        NSManagedObjectContext *context=[[self appDelegate].xmppMessageArchivingCoreDataStorage mainThreadManagedObjectContext];
        NSEntityDescription *messageEntity = [NSEntityDescription entityForName:@"XMPPMessageArchiving_Contact_CoreDataObject" inManagedObjectContext:context];
          [messagesCoreD setEntity:messageEntity];
        [messagesCoreD setIncludesPropertyValues:NO]; //only fetch the managedObjectID
        NSString *predicateFrmt = @"bareJidStr == %@";
        NSString *predicateFrmt1 = @"streamBareJidStr == %@";
        NSPredicate *predicateName = [NSPredicate predicateWithFormat:predicateFrmt,userJid];
        NSPredicate *predicateSSID = [NSPredicate predicateWithFormat:predicateFrmt1,userJid1];

        NSArray *subPredicates = [NSArray arrayWithObjects:predicateName, predicateSSID, nil];

        NSPredicate *orPredicate = [NSCompoundPredicate andPredicateWithSubpredicates:subPredicates];

        messagesCoreD.predicate = orPredicate;
        NSError * error = nil;
        NSArray * messages = [context executeFetchRequest:messagesCoreD error:&error];
        //error handling goes here
         [tableView reloadData];
        for (NSManagedObject * message in messages)
        {
            [context deleteObject:message];
            [tableView reloadData];
        }
        NSEntityDescription *messageEntity1 = [NSEntityDescription entityForName:@"XMPPMessageArchiving_Message_CoreDataObject" inManagedObjectContext:context];
        [messagesCoreD setEntity:messageEntity1];
        [messagesCoreD setIncludesPropertyValues:NO]; //only fetch the managedObjectID

        messagesCoreD.predicate = orPredicate;
        NSArray * messages1 = [context executeFetchRequest:messagesCoreD error:&error];
        //error handling goes here
        [tableView reloadData];
        for (NSManagedObject * message in messages1)
        {
            [context deleteObject:message];
            [tableView reloadData];
        }

        NSError *saveError = nil;
        [context save:&saveError];

}

0 个答案:

没有答案