gpt4 book ai didi

iPhone:如何让 VoiceOver 识别标准手势

转载 作者:可可西里 更新时间:2023-11-01 05:00:22 28 4
gpt4 key购买 nike

现在我有一些非常简单的代码设置来识别手势。但是,当我的设备启用了 VoiceOver 并且我尝试使用双击手势功能(通过 voiceOver 将手势传递到应用程序)时,它似乎无法识别手势。

进一步说明:通常,如果您使用的是启用了画外音的应用程序并且该应用程序具有某种手势识别功能,您可以双击并按住一秒钟,画外音将播放提示音。然后你可以执行手势,它会通过画外音传递到应用程序中。我的问题是,当我双击并按住时,画外音不播放提示音。

所以我想知道我是否必须在我的代码中包含一些东西来通知画外音我的应用程序将使用手势,或者类似的东西。

代码:

- (void)viewDidLoad
{
[super viewDidLoad];

// Swipe Left
UISwipeGestureRecognizer *swipeLeft = [[UISwipeGestureRecognizer alloc]
initWithTarget:self action:@selector(handleSwipeLeft:)];

swipeLeft.direction = UISwipeGestureRecognizerDirectionLeft;
[self.view addGestureRecognizer:swipeLeft];
[swipeLeft release];

// Swipe Right
UISwipeGestureRecognizer *swipeRight = [[UISwipeGestureRecognizer alloc]
initWithTarget:self action:@selector(handleSwipeRight:)];

swipeRight.direction = UISwipeGestureRecognizerDirectionRight;
[self.view addGestureRecognizer:swipeRight];
[swipeRight release];
}


- (void)handleSwipeLeft:(UISwipeGestureRecognizer *)recognizer
{

CGPoint location = [recognizer locationInView:self.view];
NSLog(@"Swipe left started at (%f,%f)",location.x,location.y);
UIAccessibilityPostNotification(UIAccessibilityAnnouncementNotification, @"Swipe Left");
}

- (void)handleSwipeRight:(UISwipeGestureRecognizer *)recognizer
{

CGPoint location = [recognizer locationInView:self.view];
NSLog(@"Swipe right started at (%f,%f)",location.x,location.y);
}

最佳答案

我注意到在静音时 VoiceOver 不播放提示音。你有没有可能遇到这种情况?接收手势的功能还在。

关于iPhone:如何让 VoiceOver 识别标准手势,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6510692/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com