我如何使用 UIPageControl?
我正在制作一个应用程序,可以使用页面控件滚动 10 个图像。问题是我完全不知道如何使用页面控件。任何帮助都值得赞赏。
I am making an app where 10 images can be scrolled through using a page control. The problem is that I have absolutely no idea how to use a page control. Any help at all is appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这里有一个示例,您可以在此处阅读文档。
尝试下载并运行该示例,然后浏览该示例的文档和源代码,以了解它的作用以及如何使用它。
我通过在谷歌搜索“uipagecontrol”和“uipagecontrol example”找到了上述两个链接。
There is an example here, and you can read the documentation here.
Try downloading and running the example, then scanning through the documentation and the source code of the example to get an idea of what it is doing and how to use it.
I found the above two links by searching google for "uipagecontrol" and "uipagecontrol example".
您基本上需要添加一个滚动视图并在其上启用分页。然后添加您想要显示的每个页面的内容。在你的情况下,这将是图像。
您可以在这里找到一个非常描述性教程,在页面控件中添加图像http://www.raywenderlich.com/10518/how-to-use-uiscrollview-to-scroll-and-zoom-content
示例代码 http://cdn1.raywenderlich.com/downloads/ScrollViews.zip
You basically need to add a scrollView and enable pagination on it. Then add content of each page you want to show. In your case that will be images.
You can find a very descriptive tutorial to add images in page control from here http://www.raywenderlich.com/10518/how-to-use-uiscrollview-to-scroll-and-zoom-content
sample code http://cdn1.raywenderlich.com/downloads/ScrollViews.zip