0

我正在浏览 iPhone WWDC 2010 - 104 PhotoScroller App 的示例代码。

它适用于我的项目相关图像(PDF 页面图像)

现在我想从自定义图像启动应用程序 - 说 5。它应该在下一次滑动时显示第 6 张图像,在上一次滑动时显示第 4 张图像。

任何人都可以在这方面提供帮助吗?

4

2 回答 2

1

我认为您应该尝试修改 UIScrollView 的 contentOffset。

根据宽度框架,您应该将其设置为:

imagePos * scrollView.frame.width

其中 imagePos 开始于 0 并结束于 (nbrImage - 1)

祝你好运 ;-)

于 2010-10-07T10:30:34.653 回答
0

I made it this way. I have UIScrollView *contentView and in init I calculate frame for photo I want to display and just scroll contentView to that rect. tilePages will do everything else for you

[contentView scrollRectToVisible:[self frameForPageAtIndex:_index] animated:NO];

于 2011-12-12T09:59:10.183 回答