我正在使用UIPageViewController
和UIPageControl
来表示现有的网页数。
但是,当我将整个viewcontroller放在UITabBarViewController
中时,标签栏会隐藏UIPageControl
。
我的假设是UIPageControl
是我的viewcontroller的子视图,因此当我将viewcontroller放在tabbar中时,整个页面应该根据需要缩小以放置tabbar。我没想到标签栏会隐藏屏幕的下半部分。
我在这里有一个small sample project 来证明这个问题。
我怀疑我必须限制可见帧,这是正确的吗?建议会很棒。
更新
我的假设是对的。我想出了这个并且它有效:
CGRect rect = CGRectMake([[self view] bounds].origin.x,
[[self view] bounds].origin.y,
[[self view] bounds].size.width,
[[self view] bounds].size.height-10);
[[self.pageController view] setBounds:rect];
如果有更好的方法可以做到这一点,很高兴知道。否则我把它作为答案。
答案 0 :(得分:12)
我在使用故事板时遇到了同样的问题。
我通过删除显示我的pageViewController的视图控制器的“Under Bottom Bars”来检查问题。