我有一个button
在viewcontroller
加载一个motherViewController
。这似乎是正常工作,但由于某种原因,新引入的view
是如此之高,底部的内容被裁剪。UITabBarController裁剪
- (IBAction)LoginButton:(UIButton *)sender
{
FirstViewController *FirstView = [self.storyboard instantiateViewControllerWithIdentifier:@"First"];
SecondViewController *SecondView = [self.storyboard instantiateViewControllerWithIdentifier:@"Second"];
ThirdViewController *ThirdView = [self.storyboard instantiateViewControllerWithIdentifier:@"Third"];
FourthViewController *FourthView = [self.storyboard instantiateViewControllerWithIdentifier:@"Fourth"];
FifthViewController *FifthView = [self.storyboard instantiateViewControllerWithIdentifier:@"Fifth"];
FirstView.Username = self.UsernameBox.text;
UINavigationController *FirstNavController = [[UINavigationController alloc]init];
[FirstNavController pushViewController:FirstView animated:NO];
UINavigationController *SecondNavController = [[UINavigationController alloc]init];
[SecondNavController pushViewController:SecondView animated:NO];
UINavigationController *ThirdNavController = [[UINavigationController alloc]init];
[ThirdNavController pushViewController:ThirdView animated:NO];
UINavigationController *FourthNavController = [[UINavigationController alloc]init];
[FourthNavController pushViewController:FourthView animated:NO];
UINavigationController *FifthNavController = [[UINavigationController alloc]init];
[FifthNavController pushViewController:FifthView animated:NO];
tabBar = [[UITabBarController alloc]init];
tabBar.viewControllers = [NSArray arrayWithObjects:FirstView, SecondView, ThirdView, FourthView, FifthView, nil];
[self.view addSubview:tabBar.view];
}
工作像一个魅力,但有没有其他方式来实现这一目标,而不硬编码的位置和尺寸? –
尝试'CGRectMake(0,0,self.view.frame.size.width,self.view.frame.size.height);' – arthankamal
太棒了!有效。谢谢! –