【发布时间】:2013-12-12 23:01:04
【问题描述】:
有一个视图控制器,它有一个UIViewController 和UIScrollView。
我将UItapgesturerecognizer 添加到滚动视图中,以便在点击滚动视图上的图像时调用singleTapGessureCaptured 方法。
问题
我要做的是将所选UIscrollView(来自特定单元格)中的图像传递到新的视图控制器中。
- (void)singleTapGestureCaptured:(UITapGestureRecognizer *)gesture{
CGPoint touchPoint = [gesture locationInView:scrollView];
NSUInteger touchedPage = floorf(touchPoint.x / scrollView.frame.size.width);
if ([imageArray count] > 1) {
touchedPage = touchedPage % ([imageArray count] - 1);
}
//Push the image to another view
【问题讨论】:
-
你试过什么?这是一个几乎每天都在 StackOverflow 上被问和回答的问题,此外还有一百万个关于该主题的教程。你在哪里卡住了?
-
如果您知道合适的教程,请告诉我;我坚持将图像路径到下一个视图
标签: ios iphone uiscrollview uitapgesturerecognizer