how do i use a UIPageControl?

流过昼夜 提交于 2019-12-03 06:28:23

问题


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.


回答1:


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".




回答2:


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



来源:https://stackoverflow.com/questions/3487572/how-do-i-use-a-uipagecontrol

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!