首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >UITabBarController裁剪

UITabBarController裁剪
EN

Stack Overflow用户
提问于 2012-12-26 20:15:50
回答 2查看 98关注 0票数 0

我在加载motherViewControllerviewcontroller中有一个button。这似乎工作正常,但由于某些原因,新引入的view太高了,以至于底部的内容都被裁剪了。

代码语言:javascript
复制
- (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];

}

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2012-12-26 20:34:48

我不知道我是对是错。但这就是答案,您正在尝试将UIViewController (UITabbarController)添加到您的ViewController。因此,您需要将其定位在view中,例如

代码语言:javascript
复制
tabbar.view.frame = CGRectMake(0, 0, 320, 460);

但我唯一不知道的是,当我们添加到window时,它是如何完美定位的。通过为tabbarcontroller设置frame来尝试您的代码。

票数 1
EN

Stack Overflow用户

发布于 2012-12-26 20:31:29

试试这个-

代码语言:javascript
复制
 tabBar.tabBar.autoresizingMask = UIViewAutoresizingFlexibleBottomMargin;
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14040445

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档