ios看起来很奇怪

时间:2014-03-11 14:53:49

标签: ios view viewcontroller

我在带有SegmentControl的TabController中创建了一个TabController,但我得到了第一页上出现的奇怪边距,但是当我点击其他所有内容时,为什么这么好?

我发布了第一页和第二页:

page 1 page 1 当我点击时,我如何实现我的观点:

- (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;


}

1 个答案:

答案 0 :(得分:0)

再次感谢@Larme 。对于人们来说同样的问题。在 StoryBoard 中选择 UIViewController ,然后在 Exented Edges 所有复选框中选择取消选中

enter image description here