UIPageViewController page control background color

You can use appearance to change the color of UIPageControl as otherwise it is not accessible. Try doing it in your AppDelegate’s didFinishLaunchingWithOptions function as given below. – (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { UIPageControl *pageControl = [UIPageControl appearance]; pageControl.pageIndicatorTintColor = [UIColor lightGrayColor]; pageControl.currentPageIndicatorTintColor = [UIColor blackColor]; pageControl.backgroundColor = [UIColor blueColor]; return YES; } To apply … Read more

Can we customize the page indicator in UIPageViewController?

You can use UIAppearance to change the color of UIPageControl. Try this in your AppDelegate’s didFinishLaunchingWithOptions function. – (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { UIPageControl *pageControl = [UIPageControl appearance]; pageControl.pageIndicatorTintColor = [UIColor lightGrayColor]; pageControl.currentPageIndicatorTintColor = [UIColor blackColor]; pageControl.backgroundColor = [UIColor blueColor]; return YES; } EDIT: To apply style only to a particular view controller, use appearanceWhenContainedIn … Read more

UIPageViewController navigates to wrong page with Scroll transition style

My workaround of this bug was to create a block when finished that was setting the same viewcontroller but without animation __weak YourSelfClass *blocksafeSelf = self; [self.pageViewController setViewControllers:viewControllers direction:UIPageViewControllerNavigationDirectionForward animated:YES completion:^(BOOL finished){ if(finished) { dispatch_async(dispatch_get_main_queue(), ^{ [blocksafeSelf.pageViewController setViewControllers:viewControllers direction:UIPageViewControllerNavigationDirectionForward animated:NO completion:NULL];// bug fix for uipageview controller }); } }];

Assertion failure in UIPageViewController

So my solution to this was adding a BOOL which keeps track of my animations state. So before setting the new ViewController, I modify this too: if (!_transitionInProgress) { _transitionInProgress = YES; [self.pageController setViewControllers:@[viewController] direction:UIPageViewControllerNavigationDirectionReverse animated:YES completion:^(BOOL finished) { _transitionInProgress = !finished; }]; } So I’ll wait for my animation to finish before setting a … Read more

Disable UIPageViewController bounce

Disable UIPageViewController’s bounce Add the <UIScrollViewDelegate> delegate to your UIPageViewController’s header Set the UIPageViewController’s underlying UIScrollView’s delegates to their parent in viewDidLoad: for (UIView *view in self.view.subviews) { if ([view isKindOfClass:[UIScrollView class]]) { ((UIScrollView *)view).delegate = self; break; } } The implementation for scrollViewDidScroll is to reset the contentOffset to the origin (NOT (0,0), but … Read more

Hide dots from UIPageViewController

The page control is only displayed if the datasource implements these methods: presentationCountForPageViewController: presentationIndexForPageViewController: Simply remove your implementation of these, and the page control will not be displayed. From the datasource docs: If both of the methods in “Supporting a Page Indicator” are implemented and the page view controller’s transition style is UIPageViewControllerTransitionStyleScroll, a page … Read more

Content pushed down in a UIPageViewController with UINavigationController

So I’m adding another answer after further development and I finally think I figured out what’s going on. Seems as though in iOS7, UIPageViewController has its own UIScrollView. Because of this, you have to set automaticallyAdjustsScrollViewInsets to false. Here’s my viewDidLoad now: – (void)viewDidLoad { [super viewDidLoad]; self.automaticallyAdjustsScrollViewInsets = false; DetailViewController *detail = [[DetailViewController alloc] … Read more

How to put the UIPageControl element on top of the sliding pages within a UIPageViewController?

I didn’t have the rep to comment on the answer that originated this, but I really like it. I improved the code and converted it to swift for the below subclass of UIPageViewController: class UIPageViewControllerWithOverlayIndicator: UIPageViewController { override func viewDidLayoutSubviews() { for subView in self.view.subviews as! [UIView] { if subView is UIScrollView { subView.frame = … Read more

UIPageViewController, how do I correctly jump to a specific page without messing up the order specified by the data source?

Programming iOS6, by Matt Neuburg documents this exact problem, and I actually found that his solution feels a little better than the currently accepted answer. That solution, which works great, has a negative side effect of animating to the image before/after, and then jarringly replacing that page with the desired page. I felt like that … Read more