Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how do i use a UIPageControl?

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.

like image 622
snrbrn Avatar asked Aug 15 '10 13:08

snrbrn


People also ask

What is use of UIPageControl?

A control that displays a horizontal series of dots, each of which corresponds to a page in the app's document or other data-model entity.

How do I use page control in swift 4?

Enter Swift as Language and choose Next. For this tutorial some images are needed, so download the movies posters and drag them to the Assets Library. Go to the Storyboard and drag a Scroll View from the Object Library to the main view. Next, drag a Page Control from the Object Library below the scroll View.

What is Page Control iOS?

iOS, iPadOS A page control can adjust the appearance of indicators to provide more information about the list. For example, the control highlights the indicator of the current page so people can estimate the page's relative position in the list.


2 Answers

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

like image 52
Douglas Avatar answered Oct 19 '22 17:10

Douglas


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

like image 37
abdus.me Avatar answered Oct 19 '22 17:10

abdus.me