Bonjour,

Je vous explique mon problème.

J'ai un composant map avec différents points affichés.
Lorsque je clic sur ces points un composant MKAnnotationView (CalloutMapAnnotation) s'ouvre.
Dans cette annotation, j'ai un composant UIView (BubbleAnnotation) pour permettre de customiser l'annotation.
Et dans cette vue j'ai des labels et des boutons permettant d'accèder à différentes partie de l'application.

Le problème est que je dois rendre l'application accessible via Voice Over, mais je n'arrive à faire en sorte qu'il "lise" les informations des différents labels et boutons.

J'ai testé des choses, je me suis inspiré de ce lien :
http://useyourloaf.com/blog/2012/04/...ssibility.html


Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
 
@implementation CalloutMapAnnotationView
 
-(NSInteger)accessibilityElementCount
{
    //Retourne 1
    return [[self accessibleElements]count];
}
 
-(id)accessibilityElementAtIndex:(NSInteger)index
{
    return [[self accessibleElements] objectAtIndex:index];
}
 
-(NSInteger)indexOfAccessibilityElement:(id)element
{
    NSLog(@"accessibility_indexElement");
    return [[self accessibleElements]indexOfObject:element];
}
 
-(BOOL)isAccessibilityElement
{
    return NO;
}
Dans la fonction viewForAnnotation j'ai mis ca :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
 
[calloutAnnotationView.contentView addSubview:bubbleAnnotation];
[calloutAnnotationView setFrame:bubbleAnnotation.bounds];
 
 
UIAccessibilityElement *bubbleAnnotationElement = [[UIAccessibilityElement alloc]initWithAccessibilityContainer:bubbleAnnotation];
[bubbleAnnotationElement setAccessibilityFrame:calloutAnnotationView.frame];
[bubbleAnnotationElement setAccessibilityValue:@"Informations sur le point"];
[[calloutAnnotationView accessibleElements]addObject:bubbleAnnotationElement];
A aucun moment je rentres dans ces méthodes :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
 
@implementation BubbleAnnotation
 
-(NSInteger)accessibilityElementCount
{
    NSLog(@"accessibility_bubble_count : %u",accessibleElements.count);
    return [[self accessibleElements]count];
}
 
-(id)accessibilityElementAtIndex:(NSInteger)index
{
    NSLog(@"accessibility_bubble_element");
    return [self accessibilityElementAtIndex:index];
}
 
-(NSInteger)indexOfAccessibilityElement:(id)element
{
    NSLog(@"accessibility_bubble_index");
    return [[self accessibleElements]indexOfObject:element];
}
 
-(BOOL)isAccessibilityElement
{
    return YES;
}
accessibleElements est un NSMutableArray dans lequel j'ai ajouter les boutons et les labels.

Si vous aviez une idée ...

Merci d'avance