ios UIPageViewController,如何消除底部的差距?

时间:2013-06-13 09:05:39

标签: iphone uipagecontrol

如何删除pageViewController的底部空间?

enter image description here

所以它可以显示图像上的控件图标而不是黑色空间..

1 个答案:

答案 0 :(得分:0)

this post中提到了几种解决方案!它们是:将转换样式从UIPageViewControllerTransitionStyleScroll切换到UIPageViewControllerTransitionStylePageCurl或在viewDidLoad中实现以下代码:

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];
    }
}

thisControl.hidden = true;
self.pageController.view.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height+40);

它会自动隐藏pageControl指示符。