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

前端 未结 12 1893
逝去的感伤
逝去的感伤 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:20

    Small hack I found today..

    Please see the code below.

    self.pageController.dataSource = self;
        CGRect rect = [self.view bounds];
        rect.size.height+=37;
        [[self.pageController view] setFrame:rect];
            NSArray *subviews = self.pageController.view.subviews;
            UIPageControl *thisControl = nil;
            for (int i=0; i<[subviews count]; i++) {
                if ([[subviews objectAtIndex:i] isKindOfClass:[UIPageControl class]]) {
                    thisControl = (UIPageControl *)[subviews objectAtIndex:i];
                }
            }
    
            UIView *tempview = [[UIView alloc] initWithFrame:CGRectMake(0, -30, 320, 40)];
            [tempview addSubview:thisControl];
            thisControl.pageIndicatorTintColor = [UIColor lightGrayColor];
            thisControl.currentPageIndicatorTintColor = [UIColor greenColor];
            [self.view addSubview:tempview];
    

提交回复
热议问题