我在带有SegmentControl的TabController中创建了一个TabController,但我得到了第一页上出现的奇怪边距,但是当我点击其他所有内容时,为什么这么好?
我发布了第一页和第二页:
当我点击时,我如何实现我的观点:
- (void)setSelectedIndex:(NSInteger) position
{
UIViewController* selectedController = [self.viewControllers objectAtIndex:position];
if (self.lastPositionOfPage == -1)
self.lastPositionOfPage = 0;
else
{
[selectedController willMoveToParentViewController:nil];
[selectedController.view removeFromSuperview];
[selectedController removeFromParentViewController];
}
[selectedController willMoveToParentViewController:self];
[self addChildViewController:selectedController];
[self.content addSubview:selectedController.view];
[selectedController didMoveToParentViewController:self];
self.lastPositionOfPage = position;
}
答案 0 :(得分:0)
再次感谢@Larme 。对于人们来说同样的问题。在 StoryBoard 中选择 UIViewController ,然后在 Exented Edges 所有复选框中选择取消选中