【发布时间】:2011-11-02 15:53:58
【问题描述】:
我目前正在使用UIPanGestureRecognizer 在我的 ipad 屏幕中翻译图像,但问题是图像超出了屏幕。
那么我怎样才能限制 ipad 屏幕外的图像移动。
- (void)translate:(UIPanGestureRecognizer *)gesture {
CGPoint myTranslation = [gesture translationInView:self];
self.transform = CGAffineTransformTranslate(self.transform, myTranslation.x, myTranslation.y);
[gesture setTranslation:CGPointZero inView:self];
}
【问题讨论】:
标签: iphone ipad uiimage restrict uipangesturerecognizer