2011-09-06 75 views

回答

1
UIAccessibilityIsVoiceOverRunning() 

如果正在運行,則返回BOOLYES。這是iOS 4及更高版本。

1

如果您需要它作爲通知,UIAccessibilityVoiceOverStatusChanged(也4.0+)。

+0

謝謝 !這是很久以前的事了。但不管怎麼說 –

0

在應用程序委託的applicationDidFinishLaunching:方法,訂閱這樣的VoiceOver的狀態變化:

// subscribing to VoiceOver change notification: 
[[NSNotificationCenter defaultCenter] 
    addObserver:self 
    selector:@selector(didChangeVoiceOverSetting:) 
    name:UIAccessibilityVoiceOverStatusChanged 
    object:nil]; 

然後做你需要做的。在我的應用我有一大堆這是建立在我的代碼的viewDidLoad方法輔助功能代碼,所以最簡單的辦法是隻上崩潰VoiceOver的變化的應用,並允許所有內容被重新初始化:

- (void)didChangeVoiceOverSetting:(NSNotification *)dictionary { 
    // intentionally crashing the app if VoiceOver is changed 
    assert(false); 
}