UIPageViewController page control background color

后端 未结 9 1324
一个人的身影
一个人的身影 2020-12-13 00:23

i\'m using UIPageViewController in my app and it\'s working fine. however, it\'s page control which has been added automatically has a black background which is hiding the c

9条回答
  •  自闭症患者
    2020-12-13 00:35

    Just subclass UIPageViewController and add this code:

    - (void)viewDidLayoutSubviews {
      [super viewDidLayoutSubviews];
      for (UIView *view in self.view.subviews) {
        if ([view isKindOfClass:[NSClassFromString(@"_UIQueuingScrollView") class]]) {
          CGRect frame = view.frame;
          frame.size.height = view.superview.frame.size.height;
          view.frame = frame;
        }
      }
    }
    

    This will extend internal scroll view frame.

提交回复
热议问题