iphone:UIScrollView 分页启用,无缩放和无预览
我想实现一个启用分页的 UIScrollView,我可以只浏览一些图像。这就是我现在想做的一切。
到目前为止,我已经在界面生成器中完成了此操作:有人可以帮忙吗?
我不知道剩下的该怎么做。有人可以帮我解决这个问题吗?我不需要任何缩放功能。我不想在滚动视图中预览上一张或下一张图像,我只想要一个简单的启用分页的滚动视图,允许用户轻拂图像。
感谢所有帮助。 如果您能一步一步告诉我如何实现这一目标,我将不胜感激。谢谢。
我查看了代码示例,发现它们过于复杂。我看过几个并且更喜欢从头开始的教程。谢谢
i want to implement a UIScrollView where paging is enabled and i can just flick through some images. Thats all i want to be able to do for now.
I have done this so far in interface builder: can someone help?
I dont know how to do the rest. Can someone please help me with this. I dont need any zooming functionality. I dont want any preview of the previous or next image within the scrollview, i just want a simple paging enabled scroll view that allows a user to flick through images.
All help is appreciated.
If you could tell me step by step how i could achieve this that would be most appreciated. thank you.
I've looked at code examples and they just have too much complexity going on. Ive looked at several and prefer a tutorial from the beginning. thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
也许你想看看我的示例实现的视图控制器,它确实做到了这一点。我写这个东西作为这个问题的答案。
也许这对您来说太复杂了,但它不会变得更容易。
这只是基本版本,它在启动时将所有图像加载到内存中。这在实际应用中是行不通的。所以你必须实现一些 UIScrollView-Delegate 函数。复杂性就从这里开始......
maybe you want to take a look at my sample implementation of a viewcontroller that does exact this. I wrote this thing as answer to this question.
Maybe this is too complicated for you, but it won't get any easier.
And this is only the basic version, which loads all images into memory at start. This will not work in a real application. So you have to implement some UIScrollView-Delegate functions. And there the complexity starts...
听起来您只需将内容添加为 UIScrollView 的子视图并添加手势识别器。
将图像加载到 UIImageView 中。添加 UIImageView 作为 UIScrollView 的子视图。
将 UISwipeGestureRecognizer 添加到 UIScrollView。
在 UISwipeGestureRecognizer 处理程序上,更改 UIImageView 中加载的图像。
Sounds like you just need to add your content as a subview of the UIScrollView and add a gesture recognizer.
Load your image into a UIImageView. Add the UIImageView as subview of the UIScrollView.
Add a UISwipeGestureRecognizer to the UIScrollView.
On the UISwipeGestureRecognizer handler, change the loaded image in the UIImageView.