I want to hide the page control indicator on a certain VC and instead show a button with the text 'Get started'. The user has however still be able to navigate back into the page control.
I've tried this:
self.pageController = [UIPageControl appearance];
self.pageController.pageIndicatorTintColor = [UIColor redColor];
self.pageController.currentPageIndicatorTintColor = [UIColor greenColor];
if(self.pageIndex == 1){
self.pageController.hidden = YES;
NSLog(@"hide you!");
}
However, this doesn't work. setting self.pageController.hidden = YES without the if statement works, and the nslog is triggered as well. It seems that somehow this can only be set once.
I also don't know how smooth this will be. I obviously don't want it to change when the user is fully arrived on the page itself, but in the transition toward it.
What is the best way to tackle this problem?
I made it with swift, maybe it will help -
func setPageControlHidden (hidden: Bool)
{
for subView in self.view.subviews
{
if subView is UIScrollView
{
subView.frame = self.view.bounds
}
else if subView is UIPageControl
{
subView.hidden = hidden
}
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With