如何禁用UIScrollview上的左侧滚动。这是因为用户只能向右滚动?UIScrollView水平滚动 - 禁用左侧滚动
感谢
** * UPDATE * ****
这是我现在有。我有子类的UIScrollView并重写下列方法
@implementation TouchScrollView
- (BOOL)touchesShouldBegin:(NSSet *)touches withEvent:(UIEvent *)event inContentView:(UIView *)view {
NSLog(@"touchesShouldBegin: I was touched!");
return YES;
}
- (BOOL)touchesShouldCancelInContentView:(UIView *)view {
NSLog(@"touchesShouldCancelInContentView: I was touched!");
return NO;
}
在我的viewController我还设置以下属性:
scrollView.delaysContentTouches = NO;
scrollView.canCancelContentTouches = YES;
TouchesShouldBegin被调用,但touchesShouldCancelInContentView不会被调用,我不能找出原因!
谢谢
我有同样的issue.didü找出原因canCancelContentTouches不会被调用即使ID canCancelContentTouches设置为YES? – prostock 2011-05-13 20:37:17