Brian Tracy
Brian Tracy

Reputation: 6831

Elusive UIView Subclass Name

This one is really bugging me! What is the name of this UIView subclass? I'm not talking about the compass itself, but the two dots at the bottom of the view. I know it's not a private API because I have seen it before. Or am I confused and this is not a UIView at all, but a UIViewController. Which UIView / UIViewController subclass is shown here. It acts like a UIScrollView, but has distinct pages, and has the dots at the bottom of the screen that show the users relative progress through the pages. I have checked this link about UIView subclasses, but became lost after about the 45th one. http://www.themusingsofalostprogrammer.com/2010/09/list-of-every-uiview-subclass.html



(source: tqn.com)

Thankyou for your time.

Upvotes: 0

Views: 49

Answers (2)

user3386109
user3386109

Reputation: 34839

If I may add to what matt said...

To use a UIPageControl effectively, you also need a UIScrollView that contains the content. An update to the page control should result in a change to the contentOffset of the scrollView as shown in the code below. UIScrollView has a pagingEnabled property that should be set to YES to complete the illusion of paging.

- (IBAction)pageValueChanged:(UIPageControl *)sender 
{
    // self.pagedView is an IBOutlet to a UIScrollView
    [self.pagedView setContentOffset:CGPointMake( sender.currentPage * 320, 0 ) animated:YES];
}

Upvotes: 0

matt
matt

Reputation: 535566

It is a UIPageControl. It corresponds (or is supposed to correspond) to the number of "pages" the user can scroll to, sideways. Normally, it indicates how many pages there are, and which one we are on, plus it typically provides a way to scroll sideways (by tapping to its left or right).

Upvotes: 1

Related Questions