UIImageView中的UIImageView中的UIScrollView?
我想要做的是在 iPad 显示屏上显示小册子的页面,并允许用户翻阅页面(从左到右和从右到左)。用户还应该能够放大页面上的文章。
我尝试将 UIImage 放入 UIImageView 中,然后将此 UIImageView 放入 ScrollView 中。仅当我有一页时,此功能才有效。不显示第二页。
最好的方法是什么?
What I want to do is displaying pages of a brochure at the iPad Display and allow the user to flip through the pages (left to right & right to left). The user should also be able to zoom in to articles at the pages.
I tried it with laying an UIImage into a UIImageView and then this UIImageView to a ScrollView. This works only if I have one Page. The second page is not displayed.
What would be the best way to do this ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将滚动视图 pagingEnabled 属性设置为 true,然后将 contentSize 设置为所有图像视图宽度总和的大小。然后,将每个 UIImageView 添加到 UIScrollView,确保将它们彼此相邻放置。
这是一个讨论此问题的教程: http://kwigbo.com/post/758575763 /uiscrollview-image-gallery-tutorial
我不确定是否启用缩放,但这应该可以让您分页浏览图像视图。
Set your scrollview pagingEnabled property to true, then set the contentSize to a size thats the sum of widths of all the imageviews. You then add each UIImageView to the UIScrollView making sure to position them next to each other.
Here is a tutorial talking about this: http://kwigbo.com/post/758575763/uiscrollview-image-gallery-tutorial
I'm not sure about enabling zoom but that should get you paging through image views.