Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/103.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 使用UIScrollView&;延迟滚动;多个UI按钮_Ios_Uiscrollview_Uibutton_Ios8 - Fatal编程技术网

Ios 使用UIScrollView&;延迟滚动;多个UI按钮

Ios 使用UIScrollView&;延迟滚动;多个UI按钮,ios,uiscrollview,uibutton,ios8,Ios,Uiscrollview,Uibutton,Ios8,我有一个UIScrollView,其中包含一个UIView,该UIView还包含一行UIButton。我最近注意到,当用户通过触摸UIScrollView向左和向右滚动时,会有一个瞬间延迟。此外,有时UIButton会检测到刷卡,似乎会激活该按钮 - (void)setupScreen { CGRect screenRect = [[UIScreen mainScreen] bounds]; CGFloat screenWidth = screenRect.size.wid

我有一个UIScrollView,其中包含一个UIView,该UIView还包含一行UIButton。我最近注意到,当用户通过触摸UIScrollView向左和向右滚动时,会有一个瞬间延迟。此外,有时UIButton会检测到刷卡,似乎会激活该按钮

- (void)setupScreen {

     CGRect screenRect = [[UIScreen mainScreen] bounds];
     CGFloat screenWidth = screenRect.size.width;
     CGFloat screenHeight = screenRect.size.height;
     [self.view setFrame:CGRectMake(0, 0, screenWidth, screenHeight)];

     [self.view addSubview:self.scrollViewControls];
     [self.scrollViewControls setFrame:CGRectMake(0, self.view.frame.size.height - self.scrollViewControls.frame.size.height, self.view.frame.size.width, self.scrollViewControls.frame.size.height)];
     [self.scrollViewControls addSubview:self.viewControls];
     [self.scrollViewControls setContentSize:CGSizeMake(self.viewControls.frame.size.width, self.viewControls.frame.size.height)];
     [self.scrollViewControls setBackgroundColor:[self colorWithHexString:@"333a44"]];
     self.scrollViewControls.delaysContentTouches = NO;

     self.imageCache = [[NSMutableDictionary alloc] init];

     [self setupImage];

}
我在iOS 7中没有注意到这个问题,它似乎出现在iOS 8中。按下时,所有按钮都设置为触摸内部


知道如何更正此问题吗?

scrollView.delaysContentTouches=NO
搜索后,这是解决我的滚动问题的最佳解决方案


不鼓励只链接答案。如果链接断开,其他用户将无法使用答案。