How do I make the bottom bar with dots of a UIPageViewController translucent?

前端 未结 12 1902
逝去的感伤
逝去的感伤 2020-12-04 07:37

I\'m in the process of making a tutorial, and I\'m trying to emulate the style of Path\'s tutorial like so:

http://www.appcoda.com/wp-content/uploads/2013/06/UIPageV

12条回答
  •  悲&欢浪女
    2020-12-04 08:29

    I wanted to do a similar effect in the app I was working on - I used a UIPageViewController with a separate UIPageControl.

    This lets you place the UIPageControl anywhere you'd like in the view, including over the top of the UIPageViewController, and you keep its active page dot up to date via the UIPageViewController delegate method:

    - (void)pageViewController:(UIPageViewController *)pageViewController
            didFinishAnimating:(BOOL)finished
       previousViewControllers:(NSArray *)previousViewControllers
           transitionCompleted:(BOOL)completed {
        if (completed) {
            self.pageControl.currentPage = [self.pageViewControllers indexOfObject:pageViewController.viewControllers.firstObject];
        }
    }
    

    No need to traverse the subview hierarchy trying to find the internal UIPageViewController page control, nor having to resize the contents of the internal scrollview.

    Hope this helps.

提交回复
热议问题