0
我有一个UIViewController
其中UIScrollView
。在模拟器中运行时,我拖动UIScrollView
并开始正确移动,但当释放拖动时,会有一个小的延迟(大约半秒),然后视图继续移动以完成动量。UIScrollView延迟触摸释放
只有在视图中发生触摸释放时才会发生此延迟。所以,如果我在模拟器外部拖放,就不会有任何延迟。
下面是创建UIScrollView
代码:
scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
scrollView.pagingEnabled = YES;
scrollView.showsHorizontalScrollIndicator = NO;
//scrollView.delaysContentTouches = NO;
//scrollView.userInteractionEnabled = YES;
scrollView.delegate = self;
[self.view addSubview:scrollView];
// Add some sub views here
// ...
// 2 pages
scrollView.contentSize = CGSizeMake(self.view.frame.size.width*2, self.view.frame.size.height);
- 我还没有覆盖在应用程序中的任何触摸事件。
- 我还没有实现任何的UIScrollViewDelegate方法。
- 启用和禁用分页没有区别。
- 我没有在物理设备上运行这个,只是在模拟器中。
什么问题?
谢谢。
我建议先在真正的iOS设备上尝试它。 iOS模拟器不是100%准确的,并且可能存在实际设备上不存在的错误。 –
不幸的是,我目前不是付费开发者,所以我无法在设备上运行。 –