3
我正在使用UIPageViewController
和UIPageControl
来指示现有的页数。UIPageControl隐藏在UITabBar
但是,当我把整个viewcontroller里面UITabBarViewController
,标签栏隐藏UIPageControl
。
我的假设是,UIPageControl
是我的viewcontroller的子视图,因此当我把viewcontroller放在一个tabbar中时,整个页面应该根据需要收缩,以便为tabbar放置位置。我没想到tabbar会隐藏屏幕的下半部分。
我在这里有一个small sample project来演示这个问题。
我怀疑我必须限制可见框架,这是正确的吗?建议会很好。
UPDATE:
我的假设是正确的。我只是想出了这个,它的工作原理:
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];
如果有更好的方法来做到这一点,很高兴知道。否则,我把这个作为答案。
这不适合我。 – runios