【发布时间】:2014-12-05 17:32:27
【问题描述】:
我有一个 UIScrollView,它包含一个 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 中。所有按钮在按下时都设置为 Touch Inside。
知道如何纠正这个问题吗?
【问题讨论】:
标签: ios uiscrollview uibutton ios8