我不希望用户能够在屏幕上向上滑动超过2/3的项目。
我是否改变touchesBegan或touchesMoved?如果是这样,怎么样?
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
UITouch* touch = [touches anyObject];
returnLocation = [touch locationInView:self.superview];
returnLocation.x += self.frame.size.width/2-startlocation.x;
returnLocation.y += self.frame.size.width/2-startlocation.y;
}
-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{
UITouch* touch = [touches anyObject];
CGPoint currentLocation = [touch locationInView:self.superview];
self.center = currentLocation;