I have downloaded the PageControl example from developer.apple.com but i don’t know the reason why i cannot open the .xib in Interface Builder. Anyway, i cannot make use of this example for my purpose as i don’t how to remove the UIPageControl without using the Interface Builder.
So i follow the example to create a simple UIScrollView with paging feature by scrolling the screen in horizontal direction.
The project contains 3 classes:
- ScrollViewWithPagingAppDelegate – The AppDelegate of the project
- ScrollViewWithPagingViewController – The view controller of ScrollViewWithPagingView.xib. It has a NSMutableArray which contains all the MyViewController instances. Each MyViewController instance is one page in the UIScrollView.
- MyViewController – The a simple view controller which only shows the page number in MyViewController.xib with different background colors.
It should run well in in iPhone SDK 3.x.
Reference: iPhone OS Reference Library – PageControl
Update @ 2012-08-29: If you want to make it work on storyboard, please refer to this comment.