I run the tutorial when the application starts for the first time and using the UIPageViewController to do this. Everything works fine, but the background color of the UIPageViewController does not become transparent. It is always black, as shown below:

This is how I add the UIPageViewController (in the panel controller)
.h file:
@interface CHMainTabViewController : UITabBarController <UIPageViewControllerDataSource> @property (strong, nonatomic) UIPageViewController *pageViewController; @end
.m file (in viewDidLoad ):
// Create page view controller self.pageViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"PageViewController"]; self.pageViewController.dataSource = self; self.pageViewController.view.backgroundColor = [UIColor clearColor]; TutorialViewController *startingViewController = [self viewControllerAtIndex:0]; NSArray *viewControllers = @[startingViewController]; [self.pageViewController setViewControllers:viewControllers direction:UIPageViewControllerNavigationDirectionForward animated:NO completion:nil]; [self presentViewController:_pageViewController animated:YES completion:nil];
in my AppDelegate.m, I also set the background color of the UIPageControl to clear:
UIPageControl *pageControl = [UIPageControl appearance]; pageControl.pageIndicatorTintColor = [UIColor lightGrayColor]; pageControl.currentPageIndicatorTintColor = [UIColor blackColor]; pageControl.backgroundColor = [UIColor clearColor]; [pageControl setOpaque:NO]; self.window.backgroundColor = [UIColor clearColor];
I know the problem is with the background color of the UIPageViewController . Is it impossible to set the background transparency of the controller?
Please, help!
Thanks.
ios objective-c uipageviewcontroller uibackgroundcolor uipagecontrol
hyd00
source share