1

大家好

我正在尝试实现拉动和释放效果,例如UITableViewControllerUIViewController.

我正在尝试使用UIPanGestureRecognizer或可能是UIScrollview. 有什么帮助吗?

在此处输入图像描述

4

1 回答 1

0

如果您只想显示和隐藏图像,我认为您可以有效地使用 UITouch 委托方法。

您可以检查触摸移动及其方向,并在以下位置显示您的图像:

- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event;

您可以将图像放回默认位置:

- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event;

希望这可以帮助。

于 2013-06-07T12:47:24.673 回答