大佬教程收集整理的这篇文章主要介绍了从按钮上的LongPress手势呈现的iOS UIActionSheet错误地需要双击按钮才能解除,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我遇到的问题是所有按钮(包括取消按钮)都需要双击才能关闭UIActionSheet.这不是预期的行为 – 它应该像按下每个其他UIActionSheet一样按下按钮后解除.第一次按下后,我可以看到地图缩放到UIActionSheet后面的适当级别,所以我知道触摸正在正确的按钮上注册,但是第一次按下时按钮不会突出显示蓝色,并且UIActionSheet不会消失.直到我第二次按下按钮,它才会突出显示蓝色然后消除.
如果我删除了长按手势识别器并将uIActionSheet呈现在“内部触摸”上,那么一切都按预期工作.所以我知道这个手势是以某种方式干扰,任何关于修复或解决方法的想法?或者这是一个应该向Apple报告的错误?
- (void) viewDidLoad { // intitialize longpress gesture UILongPressGestureRecognizer *longPressRecognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@SELEctor(zoomOptions:)]; longPressRecognizer.minimumPressDuration = 0.5; longPressRecognizer.numberOfTouchesrequired = 1; [self.currentLOCATIOnButton addGestureRecognizer:longPressRecognizer]; } - (IBACtion) zoomOptions:(UIGestureRecognizer *)sender { NSString *title = @"Zoom to:"; UIActionSheet *zoomOptionsSheet = [[UIActionSheet alloc] initWithtitle@R_360_6964@ delegate:self cancelButtontitle:@"Cancel" destructiveButtontitle:nil otherButtontitles:@"World",@"Country",@"State",@"City",@"Current LOCATIOn",nil]; [zoomOptionsSheet showFromTabBar:appDelegate.tabbarController.tabBar]; }
- (IBACtion) zoomOptions:(UILongPressGestureRecognizer *)sender { if (sender.state == UIGestureRecognizerStateBegan) { NSString *title = @"Zoom to:"; UIActionSheet *zoomOptionsSheet = [[UIActionSheet alloc] initWithtitle@R_360_6964@ delegate:self cancelButtontitle:@"Cancel" destructiveButtontitle:nil otherButtontitles:@"World",nil]; [zoomOptionsSheet showFromTabBar:appDelegate.tabbarController.tabBar]; } }
以上是大佬教程为你收集整理的从按钮上的LongPress手势呈现的iOS UIActionSheet错误地需要双击按钮才能解除全部内容,希望文章能够帮你解决从按钮上的LongPress手势呈现的iOS UIActionSheet错误地需要双击按钮才能解除所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。