Bry*_*yan 1 iphone cocoa-touch uitabbarcontroller uiviewcontroller bounds
我有一个UITabBarController,它添加了一个viewController,但定位是关闭的.屏幕顶部有大约20px的间隙,加载的viewController的底部是隐藏的.如何调整加载的viewController的大小?
viewController = [[FlashCardViewController alloc] initWithNibName:@"FlashCardViewController" bundle:[NSBundle mainBundle]];
viewController.view.bounds = [[UIScreen mainScreen]bounds];
//viewController.view.alpha = 0.0;
//[self.view addSubview:viewController.view];
tabBarController = [[UITabBarController alloc] initWithNibName:nil bundle:nil];
tabBarController.viewControllers = [NSArray arrayWithObject:viewController];
tabBarController.view.alpha = 0.0;
[self.view addSubview:tabBarController.view];
Run Code Online (Sandbox Code Playgroud)
我试过这两个但没有运气.
tabBarController.view.bounds = [[UIScreen mainScreen] bounds];
tabBarController.view.frame = [[UIScreen mainScreen] bounds];
Run Code Online (Sandbox Code Playgroud)
这不是我想要做的事情.我想将它们设置为tabBarController查看窗口的大小和位置.
我最终手动创建了框架rect:
tabBarController.view.frame = CGRectMake(0,0,320,460);
Run Code Online (Sandbox Code Playgroud)