2011-04-02 8 views

Respuesta

18

Puede hacer que VoiceOver anunciar el texto que desee con:

UIAccessibilityPostNotification(UIAccessibilityAnnouncementNotification, @"Your text"); 

Si una etiqueta debe anunciar su texto tan pronto como se actualiza, simplemente extender la UILabel y reemplazar el método setText.

El archivo .h:

@interface UIVoicedLabel : UILabel { 

} 

@end 

y su aplicación:

#import "UIVoicedLabel.h" 

@implementation UIVoicedLabel 

- (void) setText:(NSString *)text { 
    // Set the text by calling the base class method. 
    [super setText:text]; 
    // Announce the new text. 
    UIAccessibilityPostNotification(UIAccessibilityAnnouncementNotification, text); 
} 

@end 

Esto funcionó perfectamente para mí :)

Cuestiones relacionadas